Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
FTP Batch Files
Name: Matt Date: November 27, 2003 at 09:03:50 Pacific OS: Win XP CPU/Ram: 1.6GHZ 256 RAM
Comment:
Is it possible to pass a parameter from one batch file to another whilst using the ftp command?
E.g.
Batch1.bat
ftp -i -s:C:\batch2.bat
Batch2.bat
open 199.000.011.99 username password quote site namefmt 1 cd /qdls cd general/ del file1.txt
The batch files are working fine but I want to pass a parameter from batch1 to batch2. This parameter will then replace file1.txt so it will be deleted every time the batch is run. If you need more clarity or explanation, let me know. Thanks in advance.
Name: IVO Date: November 27, 2003 at 14:10:39 Pacific
Reply:
I am not very expert of the ftp command, but as far as I know what you define a batch script (Batch2.bat) is really a trxt file of ftp command to be interpreted by the ftp commands itself and NOT by the system processor Cmd.exe or Command.com (in fact it is a ftp script not a batch file and the extension is not relevant at all).
So stated you can work around following this trick:
Omitt from Batch2.bat the last line (Del File1.txt) and set Batch1.bat as below
Echo Del %1 >> Batch2.bat ftp -i -s:C:\Batch2.bat Type Batch2.bat | Find /V "Del" > Batch2.bak Del Batch2.bat Ren Batch2.bak *.bat
If so typing Batch1 File1.txt will result in performing what you want. Adjust the pathnames as required.
May be some other guy is smarter than I can.
0
Response Number 2
Name: IVO Date: November 27, 2003 at 14:16:34 Pacific
Reply:
Replace Del with del in Batch1.bat, as ftp commands are lowercase as standatd.
Summary: Can anyone tell me how to make an ftp batch file that automatically puts in the user and the password? the ftp server is a sco unix box Thanks in advance! Matt...
Summary: I'm trying to write a DOS batch file that will determine which files are in a directory on a remote unix box and then write a ftp script go 'get' each of the files. So far I have writen a script that ...