0

I am developing desktop application for Windows and I was wondering if it is possible to configure folder permissions in such way that following scenario would work:

  1. Non-admin user runs my application.
  2. The application reads/writes files to some folder to which user that run it does not have permissions.

In short: user has access to some folder only via my application.

If this matters: the folder I want to access via application is a shared folder.

1 Answer 1

1

Firstly, let's be absolutely clear - what you are asking for is not a normal thing for your average desktop application. Applications should generally run in the user context allowing all resources to be secured on a per-user basis - the sort-of exception being apps which require enhanced privileges and request a UAC elevation.

However, some enterprise applications will use a service account to do certain operations. For example, it may use a service account to perform Active Directory operations that the running user wouldn't generally have.

To achieve this, the administrator would need to provide credentials and you'd then use impersonation to perform the required operations.

Again, though, I'll reiterate - this is not normal behaviour for a user facing desktop application.

1
  • Do I understand it correctly that I would have to store admin credentials in my application to perform impersonation?
    – Maciej
    Apr 8, 2015 at 11:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .