Author: stevedale | Posted on: 11/10/2010 8:03:06 AM | Views : 281

Hello,
  I have constructed a webservice to run a vbs script on a remote machine. The script runs perfectly and the console window that opens to run psexec hangs after the process in finished abd has to ne manually closed. Can anyone tell me if it's possible to close the console window programmatically?
Thanks,
Steve

    [WebMethod]
    public string EnableExchange()
    {
        string arg = blah blah;
        
        Process p = new Process();
        p.StartInfo.UseShellExecute = false;
        p.StartInfo.RedirectStandardOutput = true;
        p.StartInfo.FileName = @"c:\psexec.exe";
        p.Start ...

Go to the complete details ...