Jump to content

Recommended Posts

Posted

A utility of mine (ReProfiler) works on all the computers I have tested it on here, but reportedly fails in some specific (and rather obscure) circumstances on others. I think I've traced the problem to a failure to access the \root\cimv2 WMI object, which in this case is queried to get user-account information. Aut2EXE is 3.3.0.0

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
if @error then 
  msgbox(0,"WMI Error","This computer shows the error")
  exit
endif  
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_UserAccount", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

I can simulate the problem here by disabling the WMI service, but I doubt if this is the actual issue.

-Any ideas?

Posted

What makes you think WMI service is running on those failing units?

:mellow:

You may have a point. Perhaps I could include some diagnostic checks in the code. The only other thing I can think of is a firewall or 'Internet Security' package that's blocking access to WMI.

Posted

WMI might also be screwed up on those machines.

I've had to use the procedure on this page http://windowsxp.mvps.org/repairwmi.htm more than once when WMI queries weren't performing as expected.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...