Script to extract files info from ftp server
Solved/Closed
Related:
- Script to extract files info from ftp server
- Ftp models - Guide
- Free fire advance server - Guide
- Gmail incoming mail server - Guide
- Clear recent files windows 11 - Guide
- How to open msi files on android - Guide
5 responses
ftp.Hostname = "ftp.test.com"
ftp.Username = "User"
ftp.Password = "Pass"
' The default data transfer mode is "Active" as opposed to "Passive".
' Change it to Passive by setting the Passive property:
ftp.Passive = 1
' Establish an AUTH SSL secure channel after connection
' on the standard FTP port 21.
ftp.AuthTls = 1
' The Ssl property is for establishing an implicit SSL connection
' on port 990. Do not set it.
ftp.Ssl = 0
' Connect and login to the FTP server.
connectStatus = ftp.Connect()
If (connectStatus <> 1) Then
'MsgBox ftp.LastErrorText
'WScript.Quit
Main = DTSTaskExecResult_Failure
Else
dirStatus = ftp.ChangeRemoteDir("RMed")
If (dirStatus <> 1) Then
'MsgBox ftp.LastErrorText
'WScript.Quit
Main = DTSTaskExecResult_Failure
End If
'MsgBox ftp.getCurrentRemoteDir()
'specify the file path and name on the local machine
localInvoiceFile = "C:\Documents and Settings\Nathan\My Documents\2\dRMed\Invoice_RMed.txt"
localPatientFile = "C:\Documents and Settings\Nathan\My Documents\2\dRMed\Patient_RMed.txt"
'specify the file path and name on the remote machine
remoteInvoiceFile = "C:\Clients\Strat\File Uploads\Customer Uploads\RMed\Invoice_RMed.txt"
remotePatientFile = "C:\Clients\Strat\File Uploads\Customer Uploads\RMed\Patient_RMed.txt"
'MsgBox remoteInvoiceFile
'MsgBox remotePatientFile
'download the files from the remote server
transferStatus = ftp.getFile(remoteInvoiceFile, localInvoiceFile)
if (transferStatus <> 1) then
'MsgBox ftp.LastErrorText
Main = DTSTaskExecResult_Failure
else
Main = DTSTaskExecResult_Success
end if
transferStatus = ftp.GetFile(remotePatientFile, localPatientFile)
if (transferStatus <> 1) then
'MsgBox ftp.LastErrorText
Main = DTSTaskExecResult_Failure
else
Main = DTSTaskExecResult_Success
end if
END IF
ftp.Disconnect
End Function
ftp.Username = "User"
ftp.Password = "Pass"
' The default data transfer mode is "Active" as opposed to "Passive".
' Change it to Passive by setting the Passive property:
ftp.Passive = 1
' Establish an AUTH SSL secure channel after connection
' on the standard FTP port 21.
ftp.AuthTls = 1
' The Ssl property is for establishing an implicit SSL connection
' on port 990. Do not set it.
ftp.Ssl = 0
' Connect and login to the FTP server.
connectStatus = ftp.Connect()
If (connectStatus <> 1) Then
'MsgBox ftp.LastErrorText
'WScript.Quit
Main = DTSTaskExecResult_Failure
Else
dirStatus = ftp.ChangeRemoteDir("RMed")
If (dirStatus <> 1) Then
'MsgBox ftp.LastErrorText
'WScript.Quit
Main = DTSTaskExecResult_Failure
End If
'MsgBox ftp.getCurrentRemoteDir()
'specify the file path and name on the local machine
localInvoiceFile = "C:\Documents and Settings\Nathan\My Documents\2\dRMed\Invoice_RMed.txt"
localPatientFile = "C:\Documents and Settings\Nathan\My Documents\2\dRMed\Patient_RMed.txt"
'specify the file path and name on the remote machine
remoteInvoiceFile = "C:\Clients\Strat\File Uploads\Customer Uploads\RMed\Invoice_RMed.txt"
remotePatientFile = "C:\Clients\Strat\File Uploads\Customer Uploads\RMed\Patient_RMed.txt"
'MsgBox remoteInvoiceFile
'MsgBox remotePatientFile
'download the files from the remote server
transferStatus = ftp.getFile(remoteInvoiceFile, localInvoiceFile)
if (transferStatus <> 1) then
'MsgBox ftp.LastErrorText
Main = DTSTaskExecResult_Failure
else
Main = DTSTaskExecResult_Success
end if
transferStatus = ftp.GetFile(remotePatientFile, localPatientFile)
if (transferStatus <> 1) then
'MsgBox ftp.LastErrorText
Main = DTSTaskExecResult_Failure
else
Main = DTSTaskExecResult_Success
end if
END IF
ftp.Disconnect
End Function
If it's under Windows, you must use win32 api
You can ask on specialized Win32 api newsgroup :
news://194.177.96.26/comp.os.ms-windows.programmer.win32
You can ask on specialized Win32 api newsgroup :
news://194.177.96.26/comp.os.ms-windows.programmer.win32
hi
i want to display directories and its files with size present in ftp site without downloading any of file or directory.
i want to display directories and its files with size present in ftp site without downloading any of file or directory.
Didn't find the answer you are looking for?
Ask a question
i am using english language and if you have account information (ftp account information) type to places I tell you
@echo off
echo user USERNAME>ftpcmd.dat
echo PASSWORD>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo lcd>>ftpcmd.dat
echo bell>>ftpcmd.dat
echo ls YOURFTPSERVERSNAME.com>>ftpcmd.dat
echo Expect a loud beep after every transfer!!!
pause
ftp -n -s:ftpcmd.dat YOURFTPSERVERSNAME.com
Copy and Paste this in to notepad and save as whatever.bat
change 'YOURFTPSERVERSNAME.com into your ftp servers name
change 'USERNAME' to your username and change 'PASSWORD' to your password
if anyone can tell how to get into passive mode in ftp using batch
Thanks
@echo off
echo user USERNAME>ftpcmd.dat
echo PASSWORD>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo lcd>>ftpcmd.dat
echo bell>>ftpcmd.dat
echo ls YOURFTPSERVERSNAME.com>>ftpcmd.dat
echo Expect a loud beep after every transfer!!!
pause
ftp -n -s:ftpcmd.dat YOURFTPSERVERSNAME.com
Copy and Paste this in to notepad and save as whatever.bat
change 'YOURFTPSERVERSNAME.com into your ftp servers name
change 'USERNAME' to your username and change 'PASSWORD' to your password
if anyone can tell how to get into passive mode in ftp using batch
Thanks
Jan 13, 2009 at 05:46 PM
Jan 14, 2009 at 07:37 AM
Everything is there
Feb 5, 2009 at 04:35 AM
Let us say that you have user1 user 2 and user3 (registered in Windows environment)
Extracting their logon/logoff sessions seems to cause several issues when the goal is to eliminate other useless info from windows generated log events:
Looking for output in the format:
User: T1 Computer: C1 Date: 02/14/2009 Logon: 9:00 Logoff: 14:00
...
User: Tn Computer: Cn Date: 02/16/2009 Logon: 11:00 Logoff: 18:00
Apr 13, 2009 at 04:36 AM
Apr 13, 2009 at 05:02 AM