I've got some batch files set up to automatically rename some files - basically just append the date to the start of the file name.
The batch file is located in the same directory as the files being renamed and everything seems to work fine when the batch file is run manually.
Batch File contents :
If I then set up a Scheduled Task to run the batch file, then it seems to fail every time. The files just aren't renamed.
I have got another very similar batch file in a different directory which just deals with one file (eg FileA) and this seems to work fine, but for some reason this one (with multiple files) fails.
I guess I could split things out into individual batch files if I had to and see if that works, but I thought I'd see if anyone had any suggestions as to what might be going wrong.
Any ideas?
The batch file is located in the same directory as the files being renamed and everything seems to work fine when the batch file is run manually.
Batch File contents :
Code:
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do rename "FileA.bak" %%f-%%e-%%d_FileA.bak
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do rename "FileB.bak" %%f-%%e-%%d_FileB.bak
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do rename "FileC.bak" %%f-%%e-%%d_FileC.bak
If I then set up a Scheduled Task to run the batch file, then it seems to fail every time. The files just aren't renamed.
I have got another very similar batch file in a different directory which just deals with one file (eg FileA) and this seems to work fine, but for some reason this one (with multiple files) fails.
I guess I could split things out into individual batch files if I had to and see if that works, but I thought I'd see if anyone had any suggestions as to what might be going wrong.
Any ideas?