Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: This script deletes all contents of a folder.
- :: This version also does not delete the root folder itself.
- @ECHO OFF
- SET FOLDER=C:\Users\Administrator\syncState
- if [%FOLDER%]==[] EXIT
- :: Delete all files in a folder
- DEL /F/Q/S "%FOLDER%" > NUL
- :: Delete all subfolders
- :: repeat because RD is sometimes buggy
- :: Newer versions of Windows do not have DELTREE command
- For /d %%G in (%FOLDER%\*) do RD /s /q "%%G"
- SET FOLDER2=C:\Users\Administrator\AppData\Local\Temp
- if [%FOLDER2%]==[] EXIT
- :: Delete all files starting with report in a folder
- DEL /F/Q/S "%FOLDER2%\report*" > NUL
- EXIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement