Share via


C# Start Program with different user credentials

Question

Thursday, May 29, 2008 1:01 AM

Hi,

 

I am writing a quick application that accesses files on a server that only a particular process ID has access to. Is there a simple way to run a program using different user credentials?

 

Edit:

This needs to be included in the code

 

All replies (5)

Thursday, May 29, 2008 2:55 AM ✅Answered

System.Diagnostics.Process.Start(

filenameToStart,

username,

password,

domain);

 


Monday, June 2, 2008 8:20 AM ✅Answered

Hi ShadyBAB,

Here is a sample in code project which introduces Windows Impersonation using C#, I think it is an alternative to your issue, please check the LINK below.

http://www.codeproject.com/KB/cs/cpimpersonation1.aspx

Regards,

Xun

 


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Thursday, May 29, 2008 3:53 AM

Thank you for the response!

 

Is there anyway to make the whole application run with these credentials?

 

If not, I'll find a way to make the above response work.


Tuesday, November 22, 2011 8:29 AM

the link says how to do impersonate the current user to different user,,

But the problem is How to start process with different user ..

for ex i want to call an exe with arguments ,, so my current user dont have access to make this, i need to call the exe as different user..

 

Can any help me out...


Wednesday, May 15, 2019 4:04 AM

Hi, I too need answer for the same..

Please help if you come to know..