You think it would be in $result, don't you?use Win32::OLE ('in'); ... @host = ($server,"Root/default",$user,$password); $localWMI = Win32::OLE->new('WbemScripting.SWbemLocator'); $WMI = $localWMI->ConnectServer(@host); $registry = $WMI->Get("StdRegProv") or die "Failed to get registry."; $strPath='SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName'; $strValue = "ComputerName"; print $strPath; $return=$registry->GetStringValue( 2147483650, $strPath, $strValue, $result ); print "\n$strValue:($return,$result)\n"; my $err = Win32::OLE->LastError(); if ($err == 0) {print "Successful!\n";} else {print $err;}
So there is no OLE error... and according to other scripts I've seen, everybody expects the query to be put in that variable... If I change the path statements/reg key name, I get funky error codes (161, -2147217403, etc.), so I know it's READING the value right.... but where does it PUT the value???
edited: Thu Mar 27 14:20:32 2003 by jeffa - appended "(problem with Win32::OLE)" to title
In reply to Where's the result??? (problem with Win32::OLE) by jpavel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |