MatthewF
asked on
What Class to use for wmi in perl
What is the Perl class to use to get the variable back of a registry key, ie
HKLM\SYSTEM\CURRENTCONTROL SET\SERVIC ES\CPQTEAM MP. I need the snippet to get these variables back. Ie
$objWMI = Win32::OLE->GetObject("win mgmts://$s trComputer /root/cimv 2");
$colNAs = $objWMI->InstancesOf(‘xxxx xxx);
HKLM\SYSTEM\CURRENTCONTROL
$objWMI = Win32::OLE->GetObject("win
$colNAs = $objWMI->InstancesOf(‘xxxx
ASKER
I am looking to use WMI
As far as I can see, WMI is just for windows process information, it doesn't have any functions for registry access.
ASKER
I am fairly certain wmi can pull registry access.
Yeah, WMI can pull registry info. I am not in a place I can check it but unless someone already posts it I will post it later. That is, the actual code you can use for an example
Well, I played around with this for a while but did not get it working.
use Win32::OLE 'in';
use Win32::OLE::Variant;
$hklm = 0x80000002;
$key = "Software";
my $objwmi = Win32::OLE->GetObject("win mgmts:\\\\ .\\root\\d efault:Std RegProv");
$objwmi->EnumKey($hklm,$ke y,$array);
foreach my $k(in $array) {
print "Result ",$k, "\n";
}
I think I need to create a Variant that EnumKey will take for $array so that I can then file through them.
This is not a solution but a start. I will look further until a better answer is given or I get this working.
Tone
use Win32::OLE 'in';
use Win32::OLE::Variant;
$hklm = 0x80000002;
$key = "Software";
my $objwmi = Win32::OLE->GetObject("win
$objwmi->EnumKey($hklm,$ke
foreach my $k(in $array) {
print "Result ",$k, "\n";
}
I think I need to create a Variant that EnumKey will take for $array so that I can then file through them.
This is not a solution but a start. I will look further until a better answer is given or I get this working.
Tone
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use Win32::TieRegistry( Delimiter=>"\" );
$one_key= $Registry->{"HKLM\SYSTEM\C