jpavel has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Where's the result??? (problem with Win32::OLE)
by jand (Friar) on Mar 26, 2003 at 20:49 UTC | |
by jpavel (Sexton) on Mar 26, 2003 at 20:52 UTC | |
by jpavel (Sexton) on Mar 26, 2003 at 21:22 UTC | |
by jand (Friar) on Mar 26, 2003 at 23:04 UTC | |
by jpavel (Sexton) on Mar 27, 2003 at 15:00 UTC | |
by jand (Friar) on Mar 27, 2003 at 22:24 UTC | |
by jand (Friar) on Mar 26, 2003 at 21:27 UTC |