# Kod tworzy klucz rejestru

use Win32::OLE;
$Win32::OLE::Warn = 3;
use constant HKLM => 0x80000002;
# ------ KONFIGURACJA SKRYPTU ------
$strKeyPath = '<KluczRejestru>'; # np. Software\Rallencorp
$strComputer = '<NazwaSerwera>'; # np. serv01 (w przypadku lokalnego serwera naley uy kropki)
# ------ KONIEC KONFIGURACJI ---------
$objReg = Win32::OLE->GetObject('winmgmts:\\\\' . $strComputer . '\\root\\default:StdRegProv');
$intRC = $objReg->CreateKey(HKLM, $strKeyPath);
if ($intRC != 0) {
    print 'Podczas tworzenia klucza wystpi bd: ' . $intRC, "\n";
}
else {
    print "Z powodzeniem utworzono klucz $strKeyPath\n";
}
