Forum Home
Press F1
 
Thread ID: 31961 2003-04-05 11:03:00 ftp help Jas_Reid (3533) Press F1
Post ID Timestamp Content User
133594 2003-04-05 11:03:00 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
Jas_Reid (3533)
133595 2003-04-05 11:13:00 What are you writing the script in... or are you writing psuedo code? Dolby Digital (160)
133596 2003-04-05 11:18:00 What is it that you need to do?

Does it need to be a batch file which downloads (or is it uploads) the file?
-=JM=- (16)
133597 2003-04-05 11:41:00 Try a CWD to the directory. If it doesn't exist, you will get a 431 return value. wuppo (41)
133598 2003-04-05 11:45:00 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.
-=JM=- (16)
133599 2003-04-05 22:38:00 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 Jas_Reid (3533)
1