1

Does anyone have a good script that will delete an old, non-booting, inactive Windows directory from the command-line?

2 Answers 2

5

Umm...

rd /s /q <directory name>

From a CMD command prompt.

How's that work for you?

Edit:

Okay-- how about:

takeown /F <directory name> /R /D Y
cacls <directory name> /T /G Everyone:F
rd /s /q <directory name>

Should be run from an elevated command-prompt.

1
  • It doesn't work because it doesn't address the various permissions and results in access denied on many files. I was playing around with something with taking ownership, then changing the permissions, and then deleting, but it doesn't seem to always work.
    – NoahD
    Jul 8, 2009 at 18:27
1

Not sure what OS you are running, but if it is Vista, instructions on deleting the windows.old directory can be found here: http://support.microsoft.com/kb/930527 or http://support.microsoft.com/kb/933212 (they pretty much say the same thing).

Edit: I see in the subject line that it is Vista... Those KB articles should do the trick.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .