Cant delete system file in windows 7

zattz
zattz used Ask the Experts™
on
Hi

I have a drive in my pc with an old install of windows on it. I am trying to delete files but I get the message "You require permission from MYUSERNAME to make changes to this file"

However, I am the correct user. I have administrator rights. I am the file owner, and under "effective permissions" everything is ticked for my username.

Can anybody help?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
TechnoChatWintel Administrator / Cloud Computing

Commented:
"You require permission from MYUSERNAME to make changes to this file" Does it mean that you need the permission from you to delete the file or you r logged on into different account?

Take the ownership again, and ass only your permission, then try to delete that file, also make sure, that file not using by system or any application.

Thanks
Saugata
TechnoChatWintel Administrator / Cloud Computing

Commented:
ass > add

Mistake ..:(

Thanks
Saugata
Right click on the drive and go to properties. Go to the security tab. Scroll down to your username. What permissions are listed? If you are not listed as Full Permissions, Hit edit, select your user name and see if you can give yourself Full Rights that way.
What files/folders are you trying to delete?  They could be in use or mark as read only, system, and or hidden.  You can easily find this flags on files and folders using the ATTRIB *.* /s when you are in the folder you want to see rights on.  Also is would be helpful if you open CMD.EXE as an adminstrator.  You can do that by typing cmd in the search box on the menu and then 'Right Click' on it and select run as administrator.

Hope this helps...
simplest way (that i am using is use) boot using Linux (CD or Installed) and delete it
Simple as that
Try it
Good Luck
TechnoChatWintel Administrator / Cloud Computing

Commented:
Hay wdfdo1986,
Don't get me wrong, but to delete a file, have to boot using Linux..Are you sure, this is the simplest way to do so?

He just want to delete a file, not the entire partition.. :P

Thanks
Saugata

Author

Commented:
TechNoChat:

I am logged into the pc with my own account.
I have taken ownership multiple times.
I have removed all permissions except my own.
The files are not in use.

Cincy:

I have full permissions as I said originally

jtanton:

The files are not read only, or system, or hidden.

wdfdo:

I'm not booting linux to delete the files.

PS: I don't want to boot into safe mode either.

I want the answer as to what is protecting these files from deletion.
When i try to delete files in windows it gives me such like that errors
Thats why i use that way
If u dont like to do it ok
but its the easiest way to me rather than waching all the bullshit of Windows
in windows if a process runs which use those files it wont allow to delete it
check it if u can
but its not easy to check
ok if u really want in that way first try after restarting the machine
If it doesn't work stop one by one processes and try to delete
Hope it will work
Good Luck
@TechnoChat:
I proposed that way since I have seen enough bullshit on windows
So i prefer that way
Its easy and fast
no problem occurs since I know what I do
TechnoChatWintel Administrator / Cloud Computing

Commented:
can you checked that file is locked by some application or not..

To check that, you have to install Unlocker, after install it, right click on the file and click on unlocker to cehck the status.

Thanks
Saugata
All system files in windows 7 are protected by system itself, even administrator cannot modify it. you must take ownership for the file & folder using command line commends.

Takeown - use the appropriate switch..
TechnoChatWintel Administrator / Cloud Computing

Commented:
Unlocker Link:
http://ccollomb.free.fr/unlocker/

Thanks
Saugata
TechnoChatWintel Administrator / Cloud Computing

Commented:
Hay v_k_subramani:,
If i took the ownership of any files, I can do what ever i like to do with that file..

@wdfdo1986
I completely agree with you about deleting the file from Linux, but I don't think this is the easiest process to do so, If the system is a server, then we can not just restart that server and boot with linux live cd for deleting a single file.

Always, the will be a way out..

Thanks
Saugata
@TechnoChat: I am completely agree with you in such kind of a scenario
But as I understood this is a Desktop machine Other wise he can't use Win 7
If it is a server yeah its not the way
But in personnel usage sometimes windows lock files by itself.
Yeah I also believe always there should be a way out
But when I am with windows specially vista I am not
But I agree that Win 7 is Far far better than vista
But still I'm comfortable in that way in my personnel work

and You said "If i took the ownership of any files, I can do what ever i like to do with that file..
"
But i am afraid you are not in windows
to do that u have to be in administrator mode (similar to root mode in Linux)
But u cant swich to admin mode like in linux
so u have to relogin
For that also u have do some things to get the login capability with a different username since it won't show administrator at login

Author

Commented:
wdfdo:

Nothing is using the files. It is very easy to check with SysInterals tools.
I have also tried restarting.

vksubramani:

I have already taken ownership. These files are NOT on my primary drive.
These files are on another drive (NOT the boot drive, and not the active windows installation)

Author

Commented:
Got it to work with this:

icacls foldername /grant BUILTIN\Users:(W,D,DC) /t
Then it any one wont stop deleting it otherthan your OS crashed or problem with file
I am pretty sure there should be a process (Can be hidden or system process) that using ur files.

but I will explain an example
I have a compaq laptop
We cant create backup twice there (not actually)
To create a second Recovery Disk we have to delete a system file
this is not used in any process and i owned the permission too
but i cant delete it with windows
So i did with linux and created second set of recovery disks.
hope u got something
Congrats!!!!!!!!!!!!!
:)
TechnoChatWintel Administrator / Cloud Computing
Commented:
Can you try with SubInACL (SubInACL.exe) for getting ownership and deleting file, just give it a try..

After running CMD as Administrator, execute following:
subinacl.exe /file PathWithFilename /setowner=%username%
subinacl.exe /file PathWithFilename /grant=%username%
del /Q /F PathWithFilename

SubInACL is working fine in Windows 7/Windows 2008 Svr.

Thanks
Saugata
TechnoChatWintel Administrator / Cloud Computing

Commented:

Author

Commented:
I answered it myself

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial