Answer the question
In order to leave comments, you need to log in
How to run a process as a different user?
Good evening, I'm trying to implement the launch of a process from another Windows user. But the error occurs " System.ComponentModel.Win32Exception: "Invalid folder name ".
User login: test
Password:111
System.Security.SecureString a = new System.Security.SecureString();
a.AppendChar('1');
a.AppendChar('1');
a.AppendChar('1');
Process.Start(@"c:\windows\system32\cmd.exe", "test",a,"");
Answer the question
In order to leave comments, you need to log in
it is necessary to assume the user test with the password 111 is already created?
Perhaps it's the rights to the current folder. by default, the project is located in the folder of the current user, and access to it is open only to the owner, system and administrators (and then with a request for elevation of rights),
try adding a transition to the available territory
, and in general everything works. if there are errors, then not in this fragment
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question