Access folder as a different user

Posted on 2011-02-11
Last Modified: 2012-05-11

I have the following situation: I have a WPF application written in C#. In the application I need to access a folder on the network. This foder has the appropriate rights only for a special user. How can I, in my application, access files in this folder with the privileges of this special user?

Best regards
Question by:RTSol
  • 2
  • 2
LVL 38

Expert Comment

ID: 34870357
You (an Admin, or the 'owner' of that folder) simply need to right-click on the folder and modify the 'permissions'.

Are you familar with the process?
LVL 38

Expert Comment

ID: 34870369
LVL 12

Accepted Solution

Mamtha1982 earned 500 total points
ID: 34870573

Author Closing Comment

ID: 34870644
Impersonation was the trick. I searched a bit more and I aslo found this post:

This code worked right out of the box.

Thanks a lot for the trigger

Author Comment

ID: 34870663
PS. younghv - The idea was to not change the permissions so the user can go there outside my app and mess things up.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now