How do I get permissions to save in a folder that Windows 7 denies me from?

16

3

I'm getting this message - You don't have permissions to save in this folder - even though I am the only user on this machine, and administrator.

How can I set permissions for myself to do everything, everywhere (including saving deleting etc)?

Edit: Sorry, forgot to say which folder it was. It is a folder in Program Files, where I save my PHP files for local testing.

Sorry if Im a bit daft with all this, but I've upgraded straight from XP to 7, and having never used vista, I'm used to being allowed to have full control.

James

Posted 2009-09-01T05:20:45.810

Reputation:

Which folder is that, by the way ? Some random folder, or something linked to the system ? – Gnoupi – 2009-09-01T05:23:05.477

4Why are you saving your php files in your program files folder anyways? I would never ever do that... I would have them in a folder on separate drive (or at least partition) in case I managed to crash my OS. If it is because you have some sort of Apache installation living there with a certain web root folder, that can always be changed to something else. – Svish – 2009-09-01T06:07:53.577

I have the same problem in Vista – The Green Frog – 2009-09-01T07:52:18.873

Answers

17

This is due to UAC (User Access/Account Control) On Windows Vista / 7, and trying to write to a protected folder.

Typically Windows 7 has much lower UAC, but it is still there, especially with older programs that are trying to write to places.

You need to not double click on a file to open, but right click on the program that it opens up in, and click "Run as Administrator", for example to launch command prompt.

alt text

When you save, you should be able to write to almost anywhere.

William Hilsum

Posted 2009-09-01T05:20:45.810

Reputation: 111 572

2Well, thats a pain in the ass. – None – 2009-09-01T05:31:13.370

2Yes, it's an equivalent to the "sudo" system under linux. Even if logged as an "administrator", you need to give administrator privileges to programs who write in "sensitive" places. However, this (UAC) can be fully deactivated, for a behavior close to XP, if that bothers you much. On the detriment of security, of course. – Gnoupi – 2009-09-01T05:37:37.897

What is the File / Program you are trying to open, I may be able to find a better solution for you. – William Hilsum – 2009-09-01T05:46:41.187

I would not turn off UAC if I were you. – Corporate Geek – 2012-01-10T18:53:59.213

5

I would get out of the habit of manually creating files in the "Program Files" folder. The purpose of that location is to hold static application files. You can force the files there by changing permissions on the folder or accepting the UAC prompt when doing a manual copy but if your application expects to change data there you have to elevate privileges. See https://stackoverflow.com/questions/946420/allow-access-permission-to-write-in-program-files-of-windows-7 for a good discussion of this.

jtreser

Posted 2009-09-01T05:20:45.810

Reputation: 940

1

Excellent answer, I was about to say the same thing myself. Non-elevated applications that interact there are redirected to the user's virtual store, a brilliant feature which makes a great deal of sense for security and centralized yet individual user configurations.

– Christopher Galpin – 2010-12-21T11:15:54.707

3

To save file to a Program Folder in Windows 7, you will need to right click the folder whewre you want to save --> Properties, then go to the Security tab, highlight "Users" and then click "Edit..." Give it full control and apply, back out the windows and you should be able to save. When you are done, be sure to go back and uncheck the full control and write boxes.

sonny

Posted 2009-09-01T05:20:45.810

Reputation: 31

3

Right click the folder, click properties, open security tab, edit the users (or your computer name) tick the modify(I tick all).

It works, I also use php and save it to htdocs, it works without the need of running as admin, which wont do to folders

Someguy

Posted 2009-09-01T05:20:45.810

Reputation: 31

This solution changes the directory permission for the user as opposed to allowing the user to elevate themselves temporarily to administrator status - very useful when you're developing something within an environment that if it were in production the restriction might make a lot of sense – Neoheurist – 2015-11-25T21:46:31.277

1

This appears when you do not have enough permissions to write to this folder without your administrative credentials (given to you by UAC).

You can right-click on that folder and select Permissions. Then go to Security tab. Once you are there, you will see that Users have only read rights. Change that to Full access and Windows will not complain anymore.

Josip Medved

Posted 2009-09-01T05:20:45.810

Reputation: 8 582