Update: Patched bug in GetValues portion of code.#!/perl/bin/perl # # RegPeek.pl -- Q&D dump of registry information. use strict; use warnings; use diagnostics; use Win32::Registry; for ("HARDWARE\\DEVICEMAP\\Scsi","SYSTEM\\CurrentControlSet\\Enum\\IDE +") { print "$_\n"; ShowSubKeys($HKEY_LOCAL_MACHINE,$_,1); } sub ShowSubKeys { my ($h,$s,$level) = @_; my $hkey; my @subkeys; my %values; $h->Open($s,$hkey); $hkey->GetKeys(\@subkeys); if (@subkeys) { for (@subkeys) { print "", ' ' x ($level * 2),"$_\n"; ShowSubKeys($h,"$s\\$_",$level + 1); } } $hkey->GetValues(\%values); for (keys %values) { my ($name,$type,$value) = @{$values{$_}}; print "", ' ' x ($level * 2),"\"$name\" = \"$value\"\n" if $ty +pe eq '1'; } }
--hsm
"Never try to teach a pig to sing...it wastes your time and it annoys the pig."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Gods, Graves and the Windows Registry
by Mr. Muskrat (Canon) on Jun 27, 2003 at 13:19 UTC | |
by hsmyers (Canon) on Jun 27, 2003 at 14:51 UTC | |
by tye (Sage) on Jun 27, 2003 at 16:48 UTC | |
by hsmyers (Canon) on Jun 27, 2003 at 19:56 UTC | |
by tye (Sage) on Jun 27, 2003 at 20:27 UTC |