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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Farhan KaziSystems 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking Protocols

From novice to tech pro — start learning today.