Windows 7 Access to 'Program Files (x86)' Folder

MattC

Well-Known Member
Hi,

Newbie to the forum, here.

I write small programs for myself and friends. One of them I have just completed - which works fine on several computers - installs itself in the 'Program Files (x86)' folder. However, on my friend's computer (Win7), when it tries to access and/or create a file in the same folder it has already installed itself in, it says it does not have access rights, despite being logged on as an administrator. I am unable to change the access rights. What I don't understand is why it is able to install itself there, but not have access afterwards?

Matt
 
As a best practice you should be writing settings and after installation data to the users AppData folder, not Program Files.
 
Right, Josephur. The Program Files are the Holy Temple, I myself had problems in getting a Microsoft (!) game running when installed as default to Program Files, but installing directly to C... worked as a dream.
 
Thank Guys.

Josephur, as a rule you're right. At the time of writing the program, there was something I specifically wanted to put in the Program Files folder. However, I've re-written the program to avoid it, now. I was curious (and somewhat irritated) that, as administrator, I couldn't submit a file to the folder. (I even tried saving a simple Notepad file there, and got the same result!)

I did, temporarily get around it, though, by checking the 'Run this program as an administrator' checkbox in the 'Compatibilities' tab in the 'Properties' of the program. This allows write access to that folder in the program, but does cause a admin warning to pop up every time the program is started.

As I said, I've changed the way the program operates, so the question is, now, academic. But many thanks for the replies. Much appreciated.

Matt
 
The "for some reason" is because it is good security practice. This is the way that Windows is meant to be set up and "fixing it" would actually be breaking it. It has been like that not for a while but ever since Windows was installed. A normal user should have no reason to write to the Program Files folder and can cause damage to their installed programs by doing so.

I would strongly recommend that you don't follow the suggestion to take ownership of the folder and leave the permissions at the default.
 
Back
Top