-3

I'm trying to opening a program from different user using cmd window (is not exe file so I have to open it from there), the program is start, but the cmd open is still appear (altough I did CreateNoWindow=true).

Code:

    var p = new process();
    p.StartInfo = new ProcessStartInfo("cmd.exe", @"/C C:Windows\System32\theprogram")
    {
       Domain = mydomain, 
       Username = myusername,
       password = securepass,
       UseShellExecute = false,
       CreateNoWindow = true,
       WorkingDirectory = @"C:\Windows\System32\"
    };
    p.Start();
asdjasj
  • 1
  • 1

1 Answers1

0

Try with:

p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

Hope it helps! :)

Imrik
  • 674
  • 2
  • 14
  • 32
  • Hi, thanks. but it still doesn't work. It happens only when I'm adding username, password and domain properties. Without them, my code is working perfect... – asdjasj Jan 23 '18 at 11:54