This is perhaps one of the most impenetrable errors you’ll find on a Windows system. If Application Development isn’t your vocation then you’re probably wondering what it means and why it’s here.
"Unable to cast object of type 'System.Boolean' to type 'System.String'"
Some people see this recondite message as a pop-up every time they log into Windows. Things get even more abstruse if you click Start and type
view event
Because you might see something like this:
Log Name:Application Source WMI Event ID 10 Level : error Event filter with query "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA "Win32_Processor" AND TargetInstance.LoadPercentage > 99" could not be reactivated in namespace "//./root/CIMV2" because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected.
In the log, do you see where it says “Source WMI“? This is the Windows Management Instrumentation registration process. That’s just a bunch of techno jargon to describe the drivers that allow Powershell and VBScripts to manage your system.
Microsoft says the “unable to cast object type” error happens because the WMI registration process is left behind on the Windows 7 SP1 DVD or ISO. The registration is only supposed to happen while the DVD or ISO is being created but sometimes it erroneously tries to run on your live system. That’s why your computer is chronically beset with these stupid pop-ups.
Fortunately, you can fix this problem by running a Microsoft Fix. Some people claim they’ve absolved the issue by restoring the system to an earlier point or disabling Event logging all together; however, I think these solutions are inadequate because they don’t actually resolve the underlying issue. The fix is actually pretty easy to implement. Check it out:
Running the Microsoft Fix
Microsoft created an installer which essentially launches a VBscript that deletes the bad objects that causes the error. Visit Microsoft’s website and download the MSI installer.
Accept the license terms and click Next.
The wizard creates a restore point and then asks you to confirm that you actually wish to install it. Go ahead and click Yes
The installation completes in about 10 seconds and then politely asks you to close the window.
Now that should do it; You’re all done. If for some reason this doesn’t fix it, you can copy and paste the VBScript below into a text file and save it as microsoftfix-50688.vbs.
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\subscription") Set obj1 = objWMIService.ExecQuery("select * from __eventfilter where name='BVTFilter' and query='SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA ""Win32_Processor"" AND TargetInstance.LoadPercentage > 99'") For Each obj1elem in obj1 set obj2set = obj1elem.Associators_("__FilterToConsumerBinding") set obj3set = obj1elem.References_("__FilterToConsumerBinding") For each obj2 in obj2set WScript.echo "Deleting the object" WScript.echo obj2.GetObjectText_ obj2.Delete_ next For each obj3 in obj3set WScript.echo "Deleting the object" WScript.echo obj3.GetObjectText_ obj3.Delete_ next WScript.echo "Deleting the object" WScript.echo obj1elem.GetObjectText_ obj1elem.Delete_ Next
After saving the file, click Start, type
cmd
right click the command prompt icon and choose Run as Administrator.
Then change to the directory containing microsoftfix-50688.vbs and type this:
cscript microsoftfix-50688.vbs
Now you can reboot and the errors should be gone!