當我運行時tasklist
,我收到此錯誤。
>tasklist
ERROR: Not found
>where tasklist
C:\Windows\System32\tasklist.exe
>tasklist /?
TASKLIST [/S system [/U username [/P [password]]]]
[/M [module] | /SVC | /V] [/FI filter] [/FO format] [/NH]
...
>taskkill
ERROR: Invalid syntax. Neither /FI nor /PID nor /IM were specified.
Type "TASKKILL /?" for usage.
tasklist
在提升的管理員 shell 中執行也會出現相同的錯誤。
我發現了這一點,但還沒有定論,因為他們重新安裝了整個系統,這似乎有點矯枉過正。
我需要讓這個命令正常工作才能使用 Heroku CLI,這顯然依賴它。
我在 ServerFault 上發現了一個問題,並從管理員 shell 中嘗試了以下操作:
C:\Users\Chloe>winmgmt /salvagerepository
WMI repository salvage failed
Error code: 0x8007007E
C:\Users\Chloe>winmgmt /verifyrepository
WMI repository verification failed
Error code: 0x8007007E
C:\Users\Chloe>winmgmt /resetrepository
WMI repository reset failed
Error code: 0x8007007E
我使用 Console2 來完成上述操作。這是執行普通管理員命令提示字元時的輸出。
C:\windows\system32>tasklist
ERROR: Not found
C:\windows\system32>Winmgmt /verifyrepository
WMI repository verification failed
Error code: 0x80041002
Facility: WMI
Description: Not found
C:\windows\system32>Winmgmt /salvagerepository
WMI repository verification failed
Error code: 0x80041002
Facility: WMI
Description: Not found
C:\windows\system32>Winmgmt /resetrepository
WMI repository reset failed
Error code: 0x8007041B
Facility: Win32
Description: A stop control has been sent to a service that other running services are dependent on.
如果我停下winmgmt
來檢查,它會說“OK”,但是當我再次檢查時,它會給出錯誤。
C:\Windows\System32\wbem>net stop winmgmt
The Windows Management Instrumentation service is stopping.
The Windows Management Instrumentation service was stopped successfully.
C:\Windows\System32\wbem>winmgmt /verifyrepository
WMI repository is consistent
C:\Windows\System32\wbem>winmgmt /verifyrepository
WMI repository verification failed
Error code: 0x80041002
Facility: WMI
Description: Not found
答案1
我用這個修復了它
cd \windows\system32\wbem
net stop winmgmt
rename Repository Repository.old
net start winmgmt
tasklist # long pause as it rebuilds
某些應用程式可能安裝了未自動重建的內容。要獲得這些,請運行
for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s
參考:https://katyscode.wordpress.com/2007/02/03/tutorial-how-to-fix-wmi-corruption/