I have written a batch file, which used to work on a previous server with a similar path. This one is changed to reflect the new path.
E:\Program Files (x86)\Amazing Charts\Backup
forfiles /p "E:\Program Files (x86)\Amazing Charts\Backup" /s /m *.* /c "cmd /c Del @path" /D -3
This work fine, Â but it deletes all of the files in the Backup folder. It doesn't leave three.
forfiles /p "E:\Program Files (x86)\Amazing Charts\Backup" /s /m *.* /d -3 /c "cmd /c Del @path"
This one also works, it just wipes out all of them.
It is clearly that the part of the batch file telling Windows to leave three files is not working properly.
Any help would be appreciated.
Bert
ASKER
Thanks.
Bert