Is there a windows equivalent of sudo rm -r [directory-name]?

link|improve this question

80% accept rate
feedback

1 Answer

up vote 5 down vote accepted

deltree if I remember my DOS.


It seems it's been updated... this is what you want:

RMDIR /S

This removes the directory C:\test, with prompts :

rmdir c:\test /s

This does the same, without prompts :

rmdir c:\test /s /q

Regarding the sudo part of your question, if you need more priviliges, you can first open a new shell as another user account using the runas command, like this:

runas /user:Administrator cmd
rmdir c:\test /s /q
link|improve this answer
hmm . . . doesn't work for me. – Eric Wilson Aug 23 '10 at 19:32
1  
@FarmBoy, apologies, it would seem my memories go far too far back. I've updated the answer for Windows XP and newer. – Colin Pickard Aug 23 '10 at 19:36
yes deltree is an old DOS command. It was removed in XP and replaced by rmdir /s – heavyd Aug 23 '10 at 19:39
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.