Link to home
Start Free TrialLog in
Avatar of jazz__man
jazz__man

asked on

Open MSTSC using C# and pass along username and password. How can I do this??

Is it possible to extend this to enable the passing of a username and password?

I am on windows xp.


Process rdcProcess = new Process();

            string executable = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\mstsc.exe");
            if (executable != null)
            {
                rdcProcess.StartInfo.FileName = executable;
                rdcProcess.StartInfo.Arguments = "/v " + computerName;  // ip or name of computer to connect
                rdcProcess.Start();
            }

Thanks
ASKER CERTIFIED SOLUTION
Avatar of unknown_routine
unknown_routine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jazz__man
jazz__man

ASKER

unknown_routine

I already had this code, I got it in 2 minutes off the internet but it is not working. It opens up remote desktop but does not fill in username or password.

Thanks