This
var psi = new ProcessStartInfo("cmd")
{
Verb = "runas",
UseShellExecute = true,
Arguments = "/user:domain\\username"
};
var ps = Process.Start(psi);
does not start the command line window with the given credentials nor asks for password. I'd like to know how to use it properly.
I was told, that one shouldn't use the StartInfo.UserName, Domain and Password method because it's not safe.