Accelerating file deletion on windows
I wish to delete a lot of files on windows quickly as possible. Got any suggestions on how to do it (in batch script, windows command or ant script etc.)?
I was thinking of the following directions:
Parallel deletion. It apperats that when I delete a bunch of files it takes longer than deleting groups of these files parallely.
Any (quick!) way to make these files on creation time to "sit" closely on the disk?
Any optimizations in deletion, given that the deletion is permanat?
Any lazy mechanism windows has开发者_如何学JAVA. That is, it doesn't really delete the files at that moment, but creates the effect that it did (you won't see it on the cmd.exe dir command or on the gui, and you could create a new file with a name that used to exist etc.) and windows will continue the real deletion in the background.
Any input will be extremely helpfull, Thank you.
I find that the command line tends to be faster with file operations. For example, to delete C:\Parent\Folder\OldFolder
, open the Command Prompt and type:
CD "C:\Parent\Folder"
Attrib -R -S -H "OldFolder\*.*" /S /D /L
RD /S /Q "OldFolder"
You could try using the commmand line as Hand-E-Food said. You can use these commands to delete files and remove folders.
del /f /s /q
rd /s /q
Or use wildcards to wipe all files out from a directory:
del C:\filestodel\*.* /f /s /q
精彩评论