-1
I have the code below in . Net written in Visual Studio 2019, which activates windows. The problem is that when running windows propmpt command running with an AD admin account it asks for the password, and this I am not able to send by program/code. Someone could help in this situation?
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = “cmd.exe”;
proc.StartInfo.Arguments = “runas /user:dominio\usuario slmgr.vbs -ipk aqui serial”;
proc.StartInfo.UseShellExecute = true;
proc.Start();
only the
"runas"
would already run as admin... the user who will run this application does not have the privilege?– Leandro Angelo
the user is Adm. but no need to enter password?
– user2509556
here gave of good... but what you can do is also instead of the arguments inform in
StartInfo
– Leandro Angelo
What property of startinfo? could you give an example?
– user2509556
In mine here not enabled no. When I tested by the windows prompt straight asked password, so I think in the code is asking too. Couldn’t see that coming.
– user2509556