I'm looking for a command line utility to delete NTFS files and directories. And I want it to work: close handles, recurse, never fail, never quit, super-kill stubborn holders of handles, everything.

Any suggestions?

link|improve this question
Just be aware that trying to do what you're after can result in an unstable or frozen system. – John Gardeniers Jan 6 '10 at 3:15
feedback

3 Answers

Try this out-if the files are locked sometimes the ONLY way to delete them is during a reboot: http://www.docsdownloads.com/Tier1/dr-delete.htm

link|improve this answer
yeah, i was sort of afraid of that. – Matt Hinze Jan 6 '10 at 2:17
There is no way around the reboot for certain deletes. This can cause slightly confusing scenarios where a file still "appears" to be present but it's gone. You will get "Access Denied" errors (IIRC) if you attempt to do anything to them while they are in limbo waiting for the reboot. – Helvick Jan 6 '10 at 7:03
feedback

You didn't specify if its something that has to be done at a specific time or if you just need files deleted that are stubborn.

What about Movefile from sysinternals? It schedules up the deletion (just set the destination as "" to delete) to occur during reboot before anything can get a handle on the files: http://technet.microsoft.com/en-us/sysinternals/bb897556.aspx

And it is a commandline application so easily scripted in.

link|improve this answer
thanks, i'll try that out. it doesn't need to be scheduled, i actually plan to use it in scripts. – Matt Hinze Jan 6 '10 at 2:17
feedback

Try unlocker

http://www.filehippo.com/download_unlocker/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown