mcs26
asked on
MS DOS FTP BATCH File
Hi,
I have two MS DOS Batch files "FTSE" and "Lehmans" which are in my shared folder at work in G:\Shared\Fixed Income\Sovereign\Mark\Sche duled Tasks. The Lehmans batch file run perfectly. The FTSE file which is pretty much identical does not, I have pasued the DOS screen and see the following error message "Error opening script file txtFTSE.scp."
I have copied the text for both batch files & text files (bottom of post). Like I say the Lehman file works pefectly but the FTSE one does not. I have double checked the password, username & address but cannot find my error.
Any help would be great!
Thanks
My Batch files
FTSE
G:
G:\Shared\Fixed Income\Sovereign\Mark\Sche duled Tasks
ftp -s:txtFTSE.scp data.ftse.com
Lehmans
G:
G:\Shared\Fixed Income\Sovereign\Mark\Sche duled Tasks
ftp -s:txtLehman.scp indexftp.barcap.com
Text Files
FTSE
Username
Password
prompt n
cd data
cd gilts
cd gilts_constituents
get BGCO1406.csv "G:\Shared\Fixed Income\Sovereign\Mark\Sche duled Tasks\BGCO1406.csv" overwrite
quit
Lehmans
Username
Password
prompt n
cd point
cd download
mget *_TAPLATRI_*_Global_Barcap _HY_Index. csv "G:\Shared\Fixed Income\Sovereign\Mark\FTP\ Leh.csv" overwrite
quit
I have two MS DOS Batch files "FTSE" and "Lehmans" which are in my shared folder at work in G:\Shared\Fixed Income\Sovereign\Mark\Sche
I have copied the text for both batch files & text files (bottom of post). Like I say the Lehman file works pefectly but the FTSE one does not. I have double checked the password, username & address but cannot find my error.
Any help would be great!
Thanks
My Batch files
FTSE
G:
G:\Shared\Fixed Income\Sovereign\Mark\Sche
ftp -s:txtFTSE.scp data.ftse.com
Lehmans
G:
G:\Shared\Fixed Income\Sovereign\Mark\Sche
ftp -s:txtLehman.scp indexftp.barcap.com
Text Files
FTSE
Username
Password
prompt n
cd data
cd gilts
cd gilts_constituents
get BGCO1406.csv "G:\Shared\Fixed Income\Sovereign\Mark\Sche
quit
Lehmans
Username
Password
prompt n
cd point
cd download
mget *_TAPLATRI_*_Global_Barcap
quit
ASKER
Hi woolmilkporc,
The full name of the text file is txtFTSE and the other file is called txtLehman. Really cant see a difference between the two!
Thanks
The full name of the text file is txtFTSE and the other file is called txtLehman. Really cant see a difference between the two!
Thanks
... and the extension ".scp" ?
ASKER
No just txtFTSE. I have just tried to run the code again and changed the batch file to "ftp -s:txtFTSE data.ftse.com" (without the .scp) and the error message jsut said Error opening scripting file txtFTSE.
Yes it does seem to be pointing to the script not being found. Two suggestions:
1. Start a cmd.exe prompt. CD /d "G:\Shared\Fixed Income\Sovereign\Mark\Sche duled Tasks"
dir txt*.*
to check the filename is exactly right.
Second option is to use a different technique for the ftp scripts, have a look at the options I have in my page here, in particular the "method 3" version keeping it all in the batch file which simplifies things IMO.
http://scripts.dragon-it.co.uk/links/batch-ftp-scripting
1. Start a cmd.exe prompt. CD /d "G:\Shared\Fixed Income\Sovereign\Mark\Sche
dir txt*.*
to check the filename is exactly right.
Second option is to use a different technique for the ftp scripts, have a look at the options I have in my page here, in particular the "method 3" version keeping it all in the batch file which simplifies things IMO.
http://scripts.dragon-it.co.uk/links/batch-ftp-scripting
Please double check the filenames!
Maybe you suppressed the displaying of "known" extensions?
The files must be named as they appear in the batch files, literally.
Maybe you suppressed the displaying of "known" extensions?
The files must be named as they appear in the batch files, literally.
I suspect the file extension is possibly .txt but hidden when you look in explorer...
Steve
Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi dragon-it,
I have just copied the code above and it kinda works (I ve probably done something wrong). I changed the username to my username but is there a way to stop it asking me for my password as I require this task to run in the morning before I get into work?
Thanks
I have just copied the code above and it kinda works (I ve probably done something wrong). I changed the username to my username but is there a way to stop it asking me for my password as I require this task to run in the morning before I get into work?
Thanks
ASKER
One other thing I have noticed is after entering my password it says invalid command and then interactive mode is on but it does retrieve the file.
thanks again
thanks again
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hmm, are there any special characters in your password such as & ^()%" etc. If so might be an issue. As long as you put the password on the next line (not the word password followed by password, just the pasword) and make sure there are no spaces at the end of the lines as sometimes EE appends spaces when you copy from the page.,
You could check the script it is making using notepad instead:
(echo open data.ftse.com
echo user Username
echo Password
echo prompt n
echo cd data
echo cd gilts
echo cd gilts_constituents
echo get BGCO1406.csv "G:\Shared\Fixed Income\Sovereign\Mark\Sche duled Tasks\BGCO1406.csv" overwrite
echo quit
) > x.txt
notepad x.txt
By all means go back to the script in a seperate file way. From the same dir check the filename or from that dir do notepad txtFTSE.scp and paste in the text of your script.
Steve
You could check the script it is making using notepad instead:
(echo open data.ftse.com
echo user Username
echo Password
echo prompt n
echo cd data
echo cd gilts
echo cd gilts_constituents
echo get BGCO1406.csv "G:\Shared\Fixed Income\Sovereign\Mark\Sche
echo quit
) > x.txt
notepad x.txt
By all means go back to the script in a seperate file way. From the same dir check the filename or from that dir do notepad txtFTSE.scp and paste in the text of your script.
Steve
ASKER
Thanks very much guys for your help everything works perfectly now!
No problem. Did you need the password on the same line as the username then in the end. Each server I have used requires it on a different line but maybe this one is different?
Steve
Steve
ASKER
Yes dargon I just did the following "echo user Username Password". I have to admit I have no knowledge of MS DOS so did not even know where to start! But thanks again for your help
Mark
Mark
I'll make a note of that then for future ref. thanks Steve
wmp