How do I rename a file to user input and then FTP it, all from a batch file?
April 15, 2008 1:58 PM
Subscribe
I want to create a batch file compatible with Windows XP and Vista that will do the following:
1) Get user input (name)
2) Rename an existing file to the input name string
3) Upload the renamed file to an anonymous FTP server that takes neither username nor password (no prompting)
I don't know what the differences are between XP and Vista in terms of command line--I did read somewhere that Vista reintroduced CHOICE, but I don't want to use that if XP users don't have it. Would /p still work? I'm completely stuck on how to get the input string into a new filename.
For the FTP part, I would like the batch file to show that it's being uploaded and to wait, or something to that effect.
(Do both OSes have the same ftp.exe? But I don't know if users will have it on their systems, and it may be better to find a free command line FTP app that can upload to an anonymous FTP server without username/password. Suggestions?)
Sorry if you think there are obvious answers elsewhere, but my Google-fu isn't helping much. Thanks in advance!
posted by Ky to computers & internet (8 comments total)
3 users marked this as a favorite
The command line FTP on XP and Vista is the same. You can create a file with a list of the ftp commands (-s:filename), or anonymous (-A).
posted by mphuie at 3:12 PM on April 15, 2008