2014-09-03 66 views
0

当我尝试从visualstudio 2012 Webforms应用程序运行PSEXEC时。我得到以下错误: - StandardOut尚未重定向或该过程尚未开始。VisualStudio 2012从web应用程序错误中运行PSEXEC

我有一些非常基本的问题,以了解: -

  1. 当我运行它运行在本地主机上的web应用:2322/Default.aspx的。那么localhost默认运行在“DefaultAppPool”上吗?
  2. ApplicationPoolIdentity正在内置帐户“ApplicationPoolIdentity”上运行我试图在IIS 7.5中将其更改为“本地系统”和“网络服务”,但仍然会引发上述错误。

下面是我的代码: -

var startInfo = new ProcessStartInfo 
      { 
       CreateNoWindow = true, 
       UseShellExecute = false, 
       RedirectStandardError = true, 
       RedirectStandardInput = true, 
       FileName = @"E:\PSTools\PSExec.exe", 
       Arguments = @"\\machineA -u domain\username -p passwrd c:\Installer.exe" 
      }; 

      Process p = Process.Start(startInfo); 
      string output = p.StandardOutput.ReadToEnd(); 
      string errormessage = p.StandardError.ReadToEnd(); 
      p.WaitForExit(); 

感谢,

回答