Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|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
add comment

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

share|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
add comment

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.

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.