Question

I have written a Client/Server App that will Start an .exe file using Process.Start on a remote computer. I have 4 computers on my Home Network, I set the server app on PC2 and set the client app on PC1, I start listening on PC2 using Sockets and TCP. Then when I am ready I send a command from PC1 to startup a specific program, what I get is a 'Windows Security' Box that asks me 'Run as different User' it gives me both a username and password box to type into, after I type in an administrator user and associated password the box goes away and the program starts up as intended, the problem is I don't want to type in a username and password on the remote pc everytime I want to startup a program on the remote pc. I can send a command to shutdown the process that I just started and it works fine, but then if I try to startup the program again it requires the username and password again. Is there a way around this in C#? Is there some way to automagically send the username and password through C# so that I don't have that Windows Security Box popping up all the time?

As a side note when using Process.Start I use ProcessStartInfo to pass in the Verb argument "runas" which I thought would cause it to run as an admin.

Was it helpful?

Solution

By passing a remote pc admin username and password into the startInfo.UserName and startInfo.Password properties you are able to bypass the security window popup.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top