DIGIT-ARC read-only archive · snapshot: July 23, 2026

Cannot delete Windows folder

14 posts · originally from https://geek.digit.in/community/threads/cannot-delete-windows-folder.66949/

goobimama
goobimama Original post #1
Aug 31, 2007 at 1:56 AM
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
faraaz #2
Aug 31, 2007 at 2:01 AM
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
Aug 31, 2007 at 2:22 AM
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"
goobimama
Aug 31, 2007 at 2:33 AM
bu..bu....bhuu...bhuu....

Maybe a simple guide as to how to accomplish that?
Vishal Gupta
Aug 31, 2007 at 2:42 AM
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. :)
goobimama
Aug 31, 2007 at 3:13 AM
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
RCuber #7
Aug 31, 2007 at 4:13 AM
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
anandk #9
Aug 31, 2007 at 8:53 AM
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
gxsaurav #10
Aug 31, 2007 at 11:25 AM
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
Aug 31, 2007 at 1:38 PM
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
Sep 25, 2008 at 6:50 PM
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.
dheeraj_kumar
Sep 25, 2008 at 7:07 PM
Thanks to both vishal gupta and anandk, I was searching for this too! :)
thewisecrab
Sep 26, 2008 at 12:20 AM
Who bumped this?
Nice bump I must say
Thanks :)