Search Whitehat Blog

Friday, 4 April 2014

USING CMD TO ERASE WINDOWS.OLD JUNK

1.Open the the command prompt as an Administrator by right-clicking it and choosing Run as Administrator.
We’ve got a trio of commands to run.
In the elevated prompt paste in the following line:
takeown /F C:\Windows.old\* /R /A
 
 
Take ownership of Windows.old

takeown allows you as an Administrator to take ownership of a folder owned by another user or process.
The weird /F C:\Windows.old\* thingy means you want to take ownership of all the files in that Windows.old folder.
/R makes the command recursive.  In other words, you’ll take ownership of the parent folder, Windows.old, and all the subfolders and files contained inside.

REF:  http://fixedbyvonnie.com
PROVED : Ken Ronniez
The /A thing gives ownership to all accounts in the Administrator group (not just the currently logged in admin user).
Okay now paste in this command:

cacls C:\Windows.old\*.* /T /grant administrators:F
Grant Administrators access to Windows.old so you can delete it

cacls let’s you modify the access control on specific files.

Here we’re telling Windows that we want to give the Administrators group carte-blanche access over everything inside the C:\Windows.old folder.
We’re basically hijacking the folder.
Now paste in this final command:
rmdir /S /Q C:\Windows.old\
RMDIR Windows.old

This powerful command essentially drops an Atom bomb on the folder.
rmdir /S removes all directories and subfolders and the /Q zaps everything without bothering you for confirmation.
After running these commands you’ll undoubtedly see a prodigious sum of text scroll up the screen at a lightening speed.
That’s fine – Windows outputs the result of each file modification so you’re just seeing the results of each modified file.

The Bottom Line

If you ignore the Windows.old folder, Microsoft automatically purges it after 28 days; however, if you’re pressed for space and need it immediately you can easily delete the folder by using the Clean up systems files button in Disk Cleanup or taking ownership of the folder and removing it via the command line.

No comments:

Post a Comment