P
Przemyslaw
hi all,
I use below code to catch errors:
my $query = "Select * from Win32_Service";
my $items = $wmi->ExecQuery($query, "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly) or print "Cannot execute WMI query \'$query\': ".Win32::OLE->LastError."\n";
but Win32_Service doesn't exist and ExecQuery doesn't return any error. Win32::OLE->LastError return 0.
When I try do it by wbemtest it give me a msg box with error "Invalid class". The class doesn't exist because I don't installed WMI Provider. I want to know if WMI Provider not installed and I could get it if ExecQuery return error but it doesn't.
Is there any way to catch error message if WMI class doesn't exist?
thanks in advance
Przemyslaw
I use below code to catch errors:
my $query = "Select * from Win32_Service";
my $items = $wmi->ExecQuery($query, "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly) or print "Cannot execute WMI query \'$query\': ".Win32::OLE->LastError."\n";
but Win32_Service doesn't exist and ExecQuery doesn't return any error. Win32::OLE->LastError return 0.
When I try do it by wbemtest it give me a msg box with error "Invalid class". The class doesn't exist because I don't installed WMI Provider. I want to know if WMI Provider not installed and I could get it if ExecQuery return error but it doesn't.
Is there any way to catch error message if WMI class doesn't exist?
thanks in advance
Przemyslaw