Launching a hidden process as a different user.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • julia.druce@gmail.com

    #1

    Launching a hidden process as a different user.

    I can't seem to launch a process as a different user and hide the
    window as well. If i don't specify the user, my window launches
    hidden. But when I specify a user, the executable.exe process
    launches an empty dos prompt. How can i hide this window?

    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    System.Diagnost ics.ProcessStar tInfo tempProcess = new
    ProcessStartInf o("executable.e xe", parameters);

    tempProcess.Use rName = "username";
    tempProcess.Dom ain = "domain";
    System.Security .SecureString password = new
    System.Security .SecureString() ;
    foreach (char temp in encryption.getV al("password"). ToCharArray())
    {
    password.Append Char(temp);
    }
    tempProcess.Pas sword = password;

    tempProcess.Use ShellExecute = false;
    tempProcess.Cre ateNoWindow = true;
    tempProcess.Win dowStyle = ProcessWindowSt yle.Hidden;

    System.Diagnost ics.Process handle = Process.Start(t empProcess);

Working...