"You do not have permission to open this file..." SOLVED

TastyTeo

Distinguished
Dec 5, 2010
33
0
18,540
So i was googling to fix this problem, seen a post here that is still unresolved and I just wanted to post some additional info regarding the problem, maybe we can fix it

Facts:
-Past Windows 7 Installation, upgraded to 10, this problem only existed when i upgraded to Windows 10 so no clean install on empty drive, i upgraded with the notification popup on the taskbar
-I am the only PC user AND/OR admin
-UAC is turned all the way down (off, no notifications)
-Windows is Up to date

Screenshot of Error:
yEeVhzg.png


When error pop up?
-When i try to save edited txt / ini, whatever file under Program Files, Windows Folder, and probably all subfolders of the C: drive (the only drive i have).

If anyone want additional info I would be glad to provide, please help me sort this out, else I would have to do a clean setup and format my drive, so curious to fix it though!

Thanks everyone
 
Solution
I probably use that route to a problem at least twice a week and have never known a system where the System Administrator account is password protected so I'm afraid I'm out of ideas. How did the taking ownershp go? It's a right click on the filename, then Properties>Security tab>Advanced button>Owner.


When you say take ownership?
I mean i tried to take ownership to the whole drive by going to properties -> security tab

but no luck, i get an error when i hit APPLY and i just cancel it
 
Go into c:\windows\system32 and scroll down to the file cmd.exe then right click it. Choose RunAs Administrator then when the Command form pops up, at the prompt, type
net user Administrator /active:yes
and hit the Enter key.

Sign out and log in as Administrator and you will have sufficient permissions to delete the file or to take ownership of it.
 


Hey there, thanks for the answer, i added the command in cmd as admin and it said the command was done properly

But my computer has no Sign Out button, only Sleep, Shut Down and Restart as i am single user what should i do in this case?
 


When you click on "Start", click on your profile picture (the 2nd up above the power symbol). That will give you the option to sign out.
 




Indeed there is an option on my profile portrait, never noticed it! Thanks! Will try now
 


It says it has password and I can't log in ...
 
I probably use that route to a problem at least twice a week and have never known a system where the System Administrator account is password protected so I'm afraid I'm out of ideas. How did the taking ownershp go? It's a right click on the filename, then Properties>Security tab>Advanced button>Owner.
 
Solution


It's ok i removed the password because i was admin on my current user anyway, but i really did not want to set up a new account, i tried to go to the properties of C and on the security tab everyone had FULL CONTROL so i don't see any reason to create this new user, i will be removing it i guess, let me see if i sorted the problem though
 
I'll be using the "net user Administrator /active:no" command now i guess, but one thing that bugs me is how come the PC has another hidden administrator user without an option to delete it and just disable it temporarily while my user who is the only user and admin can be deleted...
 
It seems I have found the solution, source: click here

Here is how I solved my issue -
1. On the root folder (In my case, program files), right click, select properties, select security tab.
2. Click Advanced
3. The window that pops up should show the current owner. Click "Change." The "Select User or Group" pop up box appears.
4. In the text box, type in your current user name (you should be an admin), and hit the "Check Names" button. Your name will be replaced with the "official" system name (i.e.,preceded by computer name and back slash).
5. Click OK
6. The box disappears, sending you back to the Advanced Security Settings window.
7. A new tick box appears below owner, with the text "Replace owner on subcontainers and objects" Select this tick box.
8. I also selected the tick box "Replace all child object permission entries with inheritable permission entries from this object", but I think I had to run this twice - once with this box ticked and once without.
9. Make sure that "everyone" appears on the Permission entries window, if not, click add. The same box that appears in step 4 shows up again. Type everyone, click "Check Names" and then "OK"
9. Hit apply

I also see that the folder ownership can be changed to "everyone" - I haven't tried changing all my folder owners to this, but doing so might eliminate this issue altogether if the drive is moved to a different computer.
 
The admin separation(only elevating users when required) has been a thing on Windows for a while(I think since Vista). It is a feature to limit damage when a user runs something they should not(this was a source of MANY XP system infections with malware and other unwanted junk). While XP had the ability to have users with less permissions, no one used it.

I am not going to argue if it is good or bad. It just is what it is.

For users who do not want to change the folder permissions, any program running as admin can edit and save.

You can hit start and search for notepad. When it shows up, hold right Ctrl + Shift and hit Enter. You will get a UAC prompt about running it in admin. Say Yes

You can also right click any program and select Run as Administrator. These elevated permission programs will be able to write in most, but not all folders.