I want to delete all files in a folder that start with a certain string, for example "File_EXC" and that are .zip files.
2 Answers
CDto the correct path.DEL FILE_EXC*.ZIP- Press Enter
Would it be satisfactory to have it run at shutdown, instead of taking up process cycles by looping every 10 minutes? If so:
Open a Command Prompt, type
gpedit.mscand click OK. Expand Computer Configuration | Windows Settings | select Scripts (Startup/Shutdown) .
Double-click Shutdown in the right side pane.
Click Add, and put your batch file's filename and path in there.
Test it by shutting down and restarting, then looking for the files which should have been deleted.
If not, create a second batch file here named LOOPY.BAT which contains:
REM LOOPY.BAT
:loop
command /c batchfilename.bat
timeout /t timeToWaitBetweenCallsInSeconds /nobreak
goto :loop 2