2013-08-27 49 views
1

我試圖從PowerShell的啓動過程是這樣的: -錯誤啓動過程

$proc = (start-process $myExe -argumentList '/myArg True' -windowStyle Minimized -passthru) 

這主要工作,但間歇性地出現此錯誤: -

This command cannot be executed completely because the system cannot find all the information required.

谷歌搜索因爲這個錯誤不會產生任何結果,至少對我來說 - 這沒有意義。機器鎖定得很緊密,我懷疑有配置問題,但如果我知道錯誤是關於什麼的話,解決起來會更容易。

的消息似乎來自Microsoft.PowerShell.Commands.Management.dll

有誰知道這意味着什麼,甚至什麼「信息」它不能找到?

+0

你確定這消息是不是'$ myExe'輸出? –

+0

是的,如果你搜索那個DLL,它就在那裏作爲一個字符串。 – JonB

+1

使用dotPeek快速查看DLL源代碼,提示當出於某種原因無法啓動進程時會引發此錯誤。你確定沒有更多的輸出可用?也嘗試直接從命令提示符執行命令,看看它是否會轉儲任何錯誤。 –

回答

0

試試這個...

Set-Variable -Name myExe c:\windows\system32\cmd.exe 
$proc = (start-process -FilePath $myExe -argumentList '/k' -windowStyle Minimized -passthru) 

與你的EXE取代的cmd.exe