#!perl # The following example reads and displays the value in the DWORD registry value # HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl\AutoReboot. use Win32::OLE; use constant HKEY_LOCAL_MACHINE => 0x80000002; my $dwValue = 42; $strComputer = '.'; $oReg = Win32::OLE->GetObject('winmgmts:{impersonationLevel=impersonate}!\\\\' . $strComputer . '\\root\\default:StdRegProv'); $strKeyPath = 'SYSTEM\\CurrentControlSet\\Control\\CrashControl'; $strValueName = 'AutoReboot'; $oReg->GetDWORDValue(HKEY_LOCAL_MACHINE, $strKeyPath, $strValueName, $dwValue); print 'AutoReboot' . ' == ' . $dwValue, "\n";