Cannot delete Windows folder

Status
Not open for further replies.

goobimama

 Macboy
Okay. I'm not that dumb as to attempt to delete a Windows folder into which I'm logged into. I had a system crash, and then installed Vista on a different partition.

Now it won't let me delete the Windows folder of the earlier installation (as well as Program Files, and Program data)

I've tried unlocking software, booting into XP.

What must I do to delete this data which is hogging at least 15GB of my HDD?
 

faraaz

Evil Genius
Linux live cd which has out of the box NTFS write access? Wolvix Hunter 1.1.0 comes to mind. There's a cub edition which is a smaller download but I dunno if the cub edition incorporates NTFS write access.

I use Linux live cds to do all my trouble shooting, be it on a Windows box or a Linux box, simply because Linux sidesteps ALL the crap Windows showers all over you.
 

Vishal Gupta

Microsoft MVP
Its not letting you delete coz you don't hv proper permissions on those folders. Actually by default "TrustedInstaller" hv the ownership of those system folders. Thats why you are not able to delete them.

Just change the ownership of those folder to yourself and then assign all permissions to your account and then you'll be able to delete them.

You can also take help from the following registry file, which will add "Take Ownership" option in folders context menu and it'll be very easy to take ownership. ;)

Code:
Windows Registry Editor Version 5.00


[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
 

Vishal Gupta

Microsoft MVP
Just copy the code and paste it in notepad, then save the file with name "vishal.reg" (including quotes). Then run the file and it'll add "Take Ownership" option in folders context menus.

Now right-click on "Windows" and other folders which you want to delete and select "Take Ownership". It'll automatically change the ownership and you should be able to delete them. :)
 
OP
goobimama

goobimama

 Macboy
Can't find the picture for that smiley who bows down in respect, but its the thought that counts.

Thanks a lot for that, VIShal gupTA. I knew I could count on this forum to help me out.
 

RCuber

The Mighty Unkel!!!
Staff member
goobimama said:
Can't find the picture for that smiley who bows down in respect

You mean this one ? *us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/77.gif ( sorry its direct link :( )

Get it Here
 

anandk

Distinguished Member
Run > cleanmgr /sageset:1 > click enter.
u will get the enhanced disk cleanup utility

check the option 'remove all old/previuos windows installation files'.
 

gxsaurav

You gave been GXified
Run > cleanmgr /sageset:1 > click enter.
u will get the enhanced disk cleanup utility

check the option 'remove all old/previuos windows installation files'.

Much simpler
 

Vishal Gupta

Microsoft MVP
goobimama said:
Can't find the picture for that smiley who bows down in respect, but its the thought that counts.

Thanks a lot for that, VIShal gupTA. I knew I could count on this forum to help me out.
My pleasure. We all are here to help each other. :)
 

NucleusKore

TheSaint
Hey thanks, was looking for this one for my department pc. They installed windows again and again, put that hard disk in another system and installed windows again, and now all our old files open read only. Will try the above trick.
 
Status
Not open for further replies.
Top Bottom