I run the following code in DOS shell to generate a SCR file that I will then use to connect to a FTP server and download files.
echo open myftp.mywebsite.com >> myscript.SCR
echo myusername >> myscript.SCR
echo mypassword >> myscript.SCR
echo lcd "C:\myfolder" >> myscript.SCR
echo cd outgoing >> myscript.SCR
The above runs fine, but the BAT file gets hung up with the below code
for /F "tokens=2-4 delims=/ " %i in ('date /t') do echo get mydownloadfile_%k%i%j.TXT >> myscript.SCR
Anyone know of a workaround for this? Thanks!
Ugly as it is but you can use date/time slicing, e.g.:
This specific string is locale dependent and will only work with a US locale. For other locales you’ll need to adjust the indexes.