Program Accessing File Only

  • Thread starter Thread starter Mack
  • Start date Start date
M

Mack

I have a program that needs to view a certain file that has current
data in it. Both administrators and standard users use the program,
but standard users do not need to have access to this file. How can
allow only the program to access the file but not the standard user.

I have tried making the file viewable by only administrators, then
marked the program to run in administrator mode. This will work accept
when a standard user opens the program it requires them to enter in an
administrator password to open the program.

Any help would be appreciated!
 
Hi Mack,

You can't have it both ways. If the user accounts need to work with that
file for the program to run, you need to allow them access to it (via
permissions). If you limit it to read only, or read and execute (depending
on need), but not alter/modify/full, then they should be able to use it
without the ability to make changes. If the program needs to write to the
file while running, then you don't have this option.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP

Windows help - www.rickrogers.org
My thoughts http://rick-mvp.blogspot.com
 
Hi Mack,

You can't have it both ways. If the user accounts need to work with that
file for the program to run, you need to allow them access to it (via
permissions). If you limit it to read only, or read and execute (depending
on need), but not alter/modify/full, then they should be able to use it
without the ability to make changes. If the program needs to write to the
file while running, then you don't have this option.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVPhttp://mvp.support.microsoft.com/
Windows help -www.rickrogers.org
My thoughtshttp://rick-mvp.blogspot.com

Is there any way to have the program run as system for a standard
user?
 
Hello,

In Windows, programs cannot be assigned privileges. There is no
administrative way to do this, other than by running the program in another
user account, but this opens up a can of worms... the user can use the
credentials for the other user account to exceed their own privileges. Even
if you attempt to hide the other user account's credentials, the user can
use the UI in the program to elevate their privilege (for example, the user
could run a program from the save as/open dialog box, which will then run as
the higher-privileged user).

The correct solution here is not an administrative one but a programmatic
one.

One possible solution: The application could be architected so that the part
of it that needs to work with the protected data runs as a service running
under a system account, with the permissions on the file giving only the
service account access to it. The part of the application that is ran by
users/administrators should then talk to the service when it needs to work
with the file, and the service should then work with the file on the
application's behalf. The service could then control who has access to what
actions/information based on whether the program talking to it is an admin
or not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top