VB.NET Read/Write permissions for CommonApplicationData (C:\ProgramData\) subfolders for standard users

Hi, I am still trying to figure out read/write permissions for:

Environment.SpecialFolder.CommonApplicationData (which maps out to "C:\ProgramData\")

Open in new window


I have created a standard VB.Net application and installed it using the official Microsoft Visual Studio 2017 Installer Project on a standard Win 10 computer.  If a non-admin "standard user" runs this application, can this user:

1) Create a subfolder in this CommonApplicationData folder (e.g. "C:\ProgramData\MyApp\"?
2) Read AND Write to files in this subfolder?


What about for a local admin user, who runs this same app WITHOUT using the UAC "Run as administrator" (or modified in the Manifest).  Can this local admin user:
3) Create a subfolder in this CommonApplicationData folder (e.g. "C:\ProgramData\MyApp\"?
4) Read AND Write to files in this subfolder?



I have tested it, and it seems to work on my development computer using a standard user, but in scouring the web, I have found other sources stating that the folders/files may need to have their permissions manually modified, which I have no interest in doing.

This is supposed to hold common data to be used by all users on this computer (rather than using the local, roaming, etc. folders).  I would also prefer not to use network drives, SQL databases, etc.
eeyoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sarabandeCommented:
there is a "yes" for all your questions beside there have been explicitly made some policies or restrictions after windows setup. the latter could have be done for example by domain policies.

Sara
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I've had issues in the past writing to ProgramData, if the machine is running UAC with a high level of security. Only workaround was setting the permissions for the specific folder (either at install, or after), but I hate doing things like that.

Program Data would hold things like app-wide settings, for example. It generally doesn't hold actual data from the program (although I suppose it could).
0
eeyoAuthor Commented:
if the machine is running UAC with a high level of security.
In this case, if a local admin user ran the application once with "Run as Administrator" so that the application could create the subfolder MyApp under "C:\ProgramData" ....
1) when the application is run later (without elevation), would this same local admin user be able to save additional files inside this MyApp subfolder?
2) could a standard user save additional files inside this MyApp subfolder?
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
1) That would depend on the UAC restrictions, but in general an Admin-level user (local or otherwise) should be able to write to ProgramData, and to any subfolder under ProgramData.

2) Same as above - depends on the UAC restrictions in place. There is no guarantee that a standard user can write to ProgramData. If the files are user-specific, then save them in the Users AppData/Roaming (or Local) folder.

Note you'll only have issues if the machines are very tightly secured. In general, a Standard user should be able to write to ProgramData, or a subfolder.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.