# Kod usuwa klucz rejestru

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