Access to 'Program Files (x86)' Folder

Discussion in 'Windows 7 Help and Support' started by MattC, Aug 5, 2014.

  1. MattC

    MattC New Member

    Joined:
    Aug 5, 2014
    Messages:
    2
    Likes Received:
    0
    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
     
  2. Pauli

    Pauli Extraordinary Member
    Premium Supporter

    Joined:
    Mar 1, 2012
    Messages:
    2,499
    Likes Received:
    211
  3. Josephur

    Josephur Windows Forum Admin
    Staff Member Premium Supporter

    Joined:
    Aug 3, 2010
    Messages:
    1,019
    Likes Received:
    125
    As a best practice you should be writing settings and after installation data to the users AppData folder, not Program Files.
     
    Pauli likes this.
  4. Pauli

    Pauli Extraordinary Member
    Premium Supporter

    Joined:
    Mar 1, 2012
    Messages:
    2,499
    Likes Received:
    211
    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.
     
  5. MattC

    MattC New Member

    Joined:
    Aug 5, 2014
    Messages:
    2
    Likes Received:
    0
    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. adomclick

    adomclick New Member

    Joined:
    Nov 17, 2016
    Messages:
    12
    Likes Received:
    2
    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.
     
    ussnorway likes this.

Share This Page

Loading...