PDA

View Full Version : ftp help



Jas_Reid
05-04-2003, 11:03 PM
Hi. I have to write an ftp script for my Networking paper. I have successfully done so except for one small piece. The lecturer wants the script to check if the directory to save a downloaded file exists and if so use it, else create ther directory. We have to write the script very basically (ie in Notepad). It also needs to be for Windows 98. Can anyone help with the command(s) needed to check for the existance of the destination directory?

Thanks

Dolby Digital
05-04-2003, 11:13 PM
What are you writing the script in... or are you writing psuedo code?

-=JM=-
05-04-2003, 11:18 PM
What is it that you need to do?

Does it need to be a batch file which downloads (or is it uploads) the file?

wuppo
05-04-2003, 11:41 PM
Try a CWD to the directory. If it doesn't exist, you will get a 431 return value.

-=JM=-
05-04-2003, 11:45 PM
To find out if the directory exists you can use the IF command. Use "if /?" at the command prompt to see what it can do.

You can use something like:

if exist directory to download to echo hello


that will print "hello" to the screen if the directory exists.

Jas_Reid
06-04-2003, 10:38 AM
I have to write a batch file to run a scripted download of a file from a remote server. The script is just written in notepad & called from a batch file