in reply to Win32::OLE thru CGI
to readmy $objWMI = Win32::OLE->GetObject("winmgmts:\\\\$strComputer\\root\\c +imv2"); # or die "Failed to create object";
i.e. when OLE fails, get it OLE to tell you why it hasn't worked.my $objWMI = Win32::OLE->GetObject("winmgmts:\\\\$strComputer\\root\\c +imv2"); die "GetObject(winmgmts:\\\\$strComputer\\root\\cimv2) failed - " . Wi +n32::OLE->LastError() if Win32::OLE->LastError();
.oO(Given the context, using CPI::Carp may also prove useful)
Update:
Modified error report to give a string.
|
|---|