Created
January 6, 2020 12:18
-
-
Save joe-scalise/c8eed26be6489d581b68fcf56d3fdc6e to your computer and use it in GitHub Desktop.
Notes on Deleting Files in Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| del /F /S /Q <target> | |
| Deletes all files in target directory. Fastest, but will not get around permission issues or other stubborn file/folder issues, and also leaves behind directory structures. | |
| rmdir /S /Q <target> | |
| Helpful when removing an entire directory tree, and can be used to "clean up" the directory structures left behind from del command, but has same issues with certain files/folders. | |
| robocopy <src> <target> /MIR | out-null | |
| When source is made to be empty directory, use this command in PowerShell to overwrite stubborn folders/files that would not delete with above commands; slowest of the three. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment