DOS FTP Scripting

shadow_man

Executive Member
Joined
May 27, 2005
Messages
7,025
Reaction score
1,745
Location
Cape Town
Hi guys,

I need to script an ftp batch script for DOS.

Script needs to take file from a DOS machine and place it on a Windows machine which acts as FTP host.

On DOS machine user will name file, ftp script will then take that file and place on Windows box via FTP. However when it gets to the Windows machine I need to get it renamed to a larger naming convention (Dos handles 8 chars I think). How can I cater for that renaming process - via the original ftp upload or a script on the Windows box. It's been a while since I used DOS.

Thanks
J
 
could give you 5 ways to do it in linux. would have a heart attack if someone asked me to do this as batch script on windblows

(sorry for trolling)
 
http://www.nsftools.com/tips/MSFTP.htm

ftp [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [computer]

-v - Suppresses verbose display of remote server responses.
-n - Suppresses auto-login upon initial connection.
-i - Turns off interactive prompting during multiple file transfers.
-d - Enables debugging, displaying all ftp commands passed between the client and server.
-g - Disables filename globbing, which permits the use of wildcard chracters in local file and path names.
-s:filename - Specifies a text file containing ftp commands; the commands will automatically run after ftp starts. No spaces are allowed in this parameter.Use this switch instead of redirection (>).
-a - Use any local interface when binding data connection.
-w:windowsize - Overrides the default transfer buffer size of 4096.
computer - Specifies the computer name or IP address of the remote computer to connect to. The c

This may work for you
 
A possible alternative to Jab's part you can use this:
put filetoload.zip renamedfile

Although I'm not sure if the dos FTP client will want to enforce its own file name size conventions or if it will depend on the target OS in either case

Sent from my Nexus One using MyBroadband Android App
 
Top
Sign up to the MyBroadband newsletter
X