View Full Version : ftp help

05-04-2003, 10: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?


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

05-04-2003, 10: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?

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

05-04-2003, 10: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.

06-04-2003, 09: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