Windows 8.1: Tasklist: ERROR: Not found

0

When I run tasklist, I get this error.

>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.

Running tasklist in an elevated Administrator shell also gives the same error.

I found this, but it was inconclusive as they re-installed the whole system, which seems like overkill.

https://social.technet.microsoft.com/Forums/windowsserver/en-US/05ad8674-3846-46e6-a0cb-c289c14b9411/tasklist-error-not-found?forum=winservergen

I need to get this command working in order to use Heroku CLI which depends on it apparently.

I found a question on ServerFault and tried the following from an administrator 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

I was using Console2 for the above. This is the output when running an vanilla administrator command prompt.

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.

If I stop winmgmt and check, it says OK, but when I check again, it gives an error.

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
windows
command-line
windows-8.1
wmi
asked on Super User Jan 5, 2018 by Chloe • edited Jan 5, 2018 by Chloe

1 Answer

1

I fixed it with this

cd \windows\system32\wbem
net stop winmgmt
rename Repository Repository.old
net start winmgmt
tasklist  # long pause as it rebuilds

Some applications may have installed things that weren't rebuilt automatically. To get those, run

for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s

Reference: https://katyscode.wordpress.com/2007/02/03/tutorial-how-to-fix-wmi-corruption/

answered on Super User Jan 5, 2018 by Chloe

User contributions licensed under CC BY-SA 3.0