2012-11-25 90 views
0

PowerShell像cmd一樣運行IpConfig和WhoAmI等程序。不過,我難倒試圖運行將MpCmdRun.exe如何獲取PowerShell執行MpCmdRun.exe

Clear-Host
Set-Location "C:\Program Files\Windows Defender"
Get-ChildItem
mpcmdrun.exe

結果

Error:

mpcmdrun.exe : The term 'mpcmdrun.exe' is not recognized as the name of a cmdlet, function, script file, or operable program.

回答

2

你正在做mpcmdrun.exe。您必須執行.\mpcmdrun.exe,因爲當前文件夾.不在Powershell中的PATH中,這與cmd不同。

PS:

如果你讀了整個消息Powershell的會吐出你這麼做的時候,你說我不知道​​:

Suggestion [3,General]: The command MpCmdRun.exe was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type ".\MpCmdRun.exe". See "get-help about_Command_Precedence" for more details.

PPS:

其他命令跑,因爲他們在PATH中。

+0

它的工作!我感到驚訝和激動。謝謝。 –