whughesiii
MIS
I have a network drive that I copy SQL backup files to. The SQL version is an express version so I have to use a batch script to create the backup locally and then copy the files to the network drive. Any how, I am trying to use forfiles to remove any data older than 2 days so that the folder doesn't fill up. My code is as follows:
However I get an error:
ERROR: Invalid argument/option - '@file '.
Type "FORFILES /?" for usage.
I have tested this code on my Windows 7 PC and it works fine. However on 2008 Server it is not. I tested using a local directory, could working with a mapped network drive be the issue?
Code:
forfiles /p "Z:\" /m *.BAK /d -2 /c "cmd /c DEL @file" >> "c:\batch files\script.log" 2>&1
However I get an error:
ERROR: Invalid argument/option - '@file '.
Type "FORFILES /?" for usage.
I have tested this code on my Windows 7 PC and it works fine. However on 2008 Server it is not. I tested using a local directory, could working with a mapped network drive be the issue?