You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
714 B
Perl

use Win32::Registry;
$key = "SOFTWARE\\yourValue";
$HKEY_LOCAL_MACHINE->Open($key, $keyList);
print "Under HKEY_LOCAL_MACHINE\n\tyourValue\n";
$keyList->GetKeys(\@subKeys);
$numberOfSubKeys = @subKeys;
print "\tThere are $numberOfSubKeys keys\n";
foreach $subKey (@subKeys){
print "\t\t$subKey\n";
}
$key = "newKey";
print "\nDeleting the $key Key\n";
if (!$keyList->DeleteKey($key)){
print "Failed to delete $key\n";
}
print "Under HKEY_LOCAL_MACHINE\n\tyourValue\n";
$keyList->GetKeys(\@newSubKeys);
$numberOfSubKeys = @newSubKeys;
print "\tThere are now $numberOfSubKeys key\n";
foreach $subKey (@newSubKeys){
print "\t\t$subKey\n";
}
$keyList->Close();