Access to 'Program Files (x86)' Folder

MattC

New Member
#1
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
 


Pauli

Extraordinary Member
Premium Supporter
#2
You could try http://www.howtogeek.com/howto/wind...ership-to-explorer-right-click-menu-in-vista/

Windows 7 is highly paranoid, I'm the sole user of my computer, and I've had the same kind of problems. As have many others. The thing you don't understand... my guess is, no one understands. Hope you get it running!
 


Josephur

Windows Forum Admin
Staff member
Premium Supporter
#3
As a best practice you should be writing settings and after installation data to the users AppData folder, not Program Files.
 


Pauli

Extraordinary Member
Premium Supporter
#4
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.
 


MattC

New Member
#5
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
 


#6
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.
 


This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.