0
當我嘗試從visualstudio 2012 Webforms應用程序運行PSEXEC時。我得到以下錯誤: - StandardOut尚未重定向或該過程尚未開始。VisualStudio 2012從web應用程序錯誤中運行PSEXEC
我有一些非常基本的問題,以瞭解: -
- 當我運行它運行在本地主機上的web應用:2322/Default.aspx的。那麼localhost默認運行在「DefaultAppPool」上嗎?
- 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();
感謝,
感謝您的答覆。那解決了這個錯誤。但我正在獲取遠程服務器連接問題。我怎樣才能得到用戶帳戶/憑據在process.start運行在編程方式在C#中? – user117048 2014-09-03 21:35:54