ftp script won't lcd

Hello.
I'm working on an ftp script to automate the update to a machine. I've got everything working but one aspect of it, and that is lcd. Can anyone see what I am doing wrong? Thanks! manoire
Here it is:

@echo off
echo user xxxxxxxx> ftpcmd.dat
echo xxxxxxxx>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo lcd /c:\My Start/>>ftpcmd.dat
echo get config.txt>> ftpcmd.dat
echo get mainnopointer.exe>> ftpcmd.dat
echo get mainpointer.exe>> ftpcmd.dat
echo get alldata.zip>> ftpcmd.dat
echo get unzip.exe>> ftpcmd.dat
echo get update_step2_0204.bat>> ftpcmd.dat
echo lcd /c:\My Start\maintenance/>>ftpcmd.dat
echo get scheduled_maintenance_choose_engine.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo get scheduled_maintenance_choose_miles.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo get scheduled_maintenance_choose_model.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo get scheduled_maintenance_schedule_grid.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo lcd /c:\My Start\video/>>ftpcmd.dat
echo get gemini_dog_brakes.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo get gemini_dog_brakes_framed.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo get gemini_girlfriend.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo get gemini_girlfriend_framed.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo lcd /c:\My Start\information_center/>>ftpcmd.dat
echo get information_center.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo lcd /c:\My Start\screen_saver/>>ftpcmd.dat
echo get screen_saver.swf>> ftpcmd.datecho quit>> ftpcmd.dat
echo get screen_saver.xml>> ftpcmd.datecho quit>> ftpcmd.dat
echo quit>> ftpcmd.datecho quit>> ftpcmd.dat

ftp -n -s:ftpcmd.dat www.xxxxxxxxxxxxx.com
del ftpcmd.dat
manoireAsked:
Who is Participating?
 
Farhan KaziConnect With a Mentor Systems EngineerCommented:
Following line has two echo statements so they should be on separate lines.
echo get scheduled_maintenance_choose_engine.swf>> ftpcmd.datecho quit>> ftpcmd.dat

Like:
echo get scheduled_maintenance_choose_engine.swf>> ftpcmd.dat
echo quit>> ftpcmd.dat

OR add '&&' sign

Like:
echo get scheduled_maintenance_choose_engine.swf>> ftpcmd.dat &&echo quit>> ftpcmd.dat

Remember: if you add 'quit' in FTP script then it will end the FTP session.
0
 
Farhan KaziSystems EngineerCommented:
echo lcd /c:\My Start/>>ftpcmd.dat
              ^                 ^
Remove / from start and end.

Also enclose directory name in double quotes " " if is contains any space.

Like:
echo lcd "c:\My Star" >>ftpcmd.dat

 
0
 
manoireAuthor Commented:
Tried it, and it uploaded the file to file name "quit"
I did:
echo lcd "c:\My Start\maintenance">>ftpcmd.dat
echo get scheduled_maintenance_choose_engine.swf>> ftpcmd.datecho quit>> ftpcmd.dat

From what i can see the lcd worked now, but my next line, the get statement has an error.

Suggestions?
0
All Courses

From novice to tech pro — start learning today.