Windows 10 WMI Query fail

DexterWoo

Well-Known Member
Joined
Jan 25, 2017
Hello MS guys here,

So I have encounter an issue that WMI query to Win32_Logicdisks got no instance returned.
I noticed this issue when developing a script to copy files from UNC(use it to query the disk size make sure it won't copy too much data),at that time it seems my windows update has just installed some updates.
I tried to restart winmgnt service, and still fail. then I reboot the computer, everything works fine again!
However, a few days later, it happened again...
I don't like to reboot my computer again to fix this, so I tried another way, I killed the process that's hosting the service, and the retry the query, the issue was magically fixed this time.
So I am guessing that there might be some bug in the service. it could be winmgnt or windows update agent or something else that was hosted by that process.
Anyway, I'd like to ask you guys, have you ever encounter the same issue? How do you fix it? Would my method cause some other issue?(Although I am sticking with the method now and nothing else has been noticed by me so far) Or most importantly, will you consider this as a bug?
 
I would look in the event viewer when the query is failing and see if there are any associated errors there that you can research.
 
If you're using WMIC the query would be either
wmic logicaldisk or wmic path Win32_LogicalDisk

If you're having actual corruption issues you can open mmc.exe and load the WMI Control
Right click on WMI Control (local) > Properties
Any errors will be under the general tab
You can also run wmidiag to check for issues.

Good troubleshooting guide
WMI: Rebuilding the WMI Repository
 
Great! thank you guys, next time I encounter this, I will try these ways to troubleshoot the issue and post what I find~
 
Back
Top Bottom