Deleting All Files Starting with a Tilde

email me

Be careful with this!

You can delete all files meeting a certain criteria or pattern. For example, if you wanted to delete all files on your computer starting with a tilde:

del /s /q “~*.*”

 

You could have as easily done:

del /s /q “*.tmp”
del /s /q “*.cmd”
del /s /q “5*.*”
del /s /q “my*.*”
del /s /q “*.docx*”

del /s /q — the /s is cycle through subdirectories and the /q is quiet mode