program can't modify an INI file in subfolder of Program Files (x86)


  1. Posts : 1,775
    Windows 10 Pro
       #1

    program can't modify an INI file in subfolder of Program Files (x86)


    I have this small utility that has to be hand-installed, so I created a Utilities folder in Program Files (x86) and copied the program files into that folder.

    Everything works as expected, except that the program can't modify its INI file, which is in that same Utilities folder.

    I started to play with the Security tab in Properties for the Program Files (x86) folder, but I'm reluctant to change owners, etc, because I'm afraid that I could screw up the entire folder.

    Is there a workaround for this issue, or do I have to accept the fact that this small utility was last released in the Windows 7 days and i'm stuck with this limitation with the INI file?

    x509
      My Computers


  2. Posts : 16,961
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    In a similar situation [probably ini files for NirSoft utilities], I ran the utility in an unprotected folder and set up its options/settings before copying its ini file into a folder for long term use [in your case that would be copying it into the Program files folder you made for it].

    By the way, I don't put my own tools and utilities within Program Files. I created a folder of my own for them and applied permissions that match those used for Program Files - any changes need Admin permission so I cannot accidentally edit a tool.
    - Just like with Program files folders, the Admin permission needed to alter anything applies only to that occasion - the permission does not persist & needs to be repeated for future changes.
    - I have a set of subfolders within C:\Tools so I can see what's going on.

    1 Create folder C:\Tools
    2 Properties, Security, Advanced
    3 Disable inheritance, Confirm convert them into explicit permissions
    4 Edit - Authenticated users, Read & execute - Apply
    {this sets Read & execute, List folder contents and Read}
    {check Users is also Read & execute, as I would expect it to be}
    5 Owner, Change - Administrators [note the plural - this means any Admin account can change the contents subject to confirmation in the Admin challenge that appears]
    6 Replace owner on subcontainers & objects

    I write my batch files etc in a separate drafting folder and copying them into C:\Tools becomes, in effect, the act of publication.

    Denis
      My Computer


  3. Posts : 8,111
    windows 10
       #3

    Any folder in x86 tends to inherit permission from folder above put it in a folder outside program files should work
      My Computer


  4. Posts : 1,775
    Windows 10 Pro
    Thread Starter
       #4

    I took your advice and create a Program Files (special) top - level directory. I put my problem utility in a folder inside this main folder, and now that utility can modify its .ini file no problem. Thanks for the suggestion. And i'm giving you reputation thanks.

    x509
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:09.
Find Us




Windows 10 Forums