New Registry Key Creation : Registry « Win32 « Perl






New Registry Key Creation

   


 use Win32::Registry ;

 $key = "SOFTWARE\\newKey";
 $HKEY_LOCAL_MACHINE->Open($key, $keyList);
 print "Under HKEY_LOCAL_MACHINE\n\tyourValue\n";
 $keyList->GetKeys(\@subKeys);
 $numberOfSubKeys = @subKeys;
 print "\tThere is $numberOfSubKeys key\n";
 foreach $subKey (@subKeys){
    print "\t\t$subKey\n";
 }
 print "\nCreating the Perl6 Key\n";
 $keyList->Create("Perl6",$newKeyList);
 print "Under HKEY_LOCAL_MACHINE\n\tyourValue\n";
 $keyList->GetKeys(\@newSubKeys);
 $numberOfSubKeys = @newSubKeys;
 print "\tThere are now $numberOfSubKeys keys\n";
 foreach $subKey (@newSubKeys){
       print "\t\t$subKey\n";
 }
 $keyList->Close();
 $newKeyList->Close();

   
    
    
  








Related examples in the same category

1.Creates new key in the registry
2.A Registry Branch
3.Registry Key Deletion