As part of a regular file upload process we run a .bat file via Windows Task Scheduler. It opens WinSCPand runs it using a config file.
Then it cds to the file where the upload is stored, renames it, then moves it to the archive file.
If I run the program manually with a pause
before the exit
, it works fine. Currently is just dumping the file from upload to the archive without renaming it with time and date appended.
@echo off
"C:\Program Files (x86)\WinSCP\winscp.com" /script=CONFIG.txt
cd C:\SCHEDULEDQUERIES\PressGaney\Upload
ren *.csv CL6019_%time:~0,2%%time:~3,2%%date:~-10,2%%date:~3,2%%date:~-4,4%.csv
move *.csv C:\SCHEDULEDQUERIES\PressGaney\archive
exit
Thanks. Happy to give any further details that may be needed.