Hi,
I am new to Dos programming ...
can any one provide me a test code which will automate the process of FTP (putting file to a server).
The script needs to get User name/ pwd and the source file name and destination file name.
if there are multiple files that need to be put to the server the above process should go in a loop untill the user wants to quit.
Pls hlp.
Thanks in advance.
Automating FTP.
Moderator: DosItHelp
-
- Expert
- Posts: 80
- Joined: 04 Feb 2009 10:03
You could start with something like...
You could then view the FTPJob.Log file to see if everything transferred without errors.
Code: Select all
Cls
Set /P User=Enter UserID:
Set /P Pwd=Enter Password:
Echo Open xx.xx.xx.xx > %Temp%\FTPScript
Echo User %User% %Pwd% >> %Temp%\FTPScript
Echo CD \DestFolder >> %Temp%\FTPScript
Echo LCD \SourceFolder >> %Temp%\FTPScript
:GetAnotherFile
Set /P SName=Enter SOURCE File Name:
If /I [%SName%] EQU [Quit] Goto FTPJob
Set /P TName=Enter TARGET File Name:
Echo Put %SName% %TName% >> %Temp%\FTPScript
Set "SName="
Set "TName="
Goto GetAnotherFile
:FTPJob
ftp -n -s:%Temp%\FTPScript > %Temp%\FTPJob.Log
You could then view the FTPJob.Log file to see if everything transferred without errors.
-
- Posts: 2
- Joined: 23 Feb 2009 06:19
Hi,
Sorry for the delayed response. Thanks for you reply. It solved my issue.Thanks a Lot.
Sorry for the delayed response. Thanks for you reply. It solved my issue.Thanks a Lot.
Last edited by samuel_inba on 04 Mar 2009 05:06, edited 1 time in total.