Skip to content

$cs.Reg_SetDword

Writes a 32-bit REG_DWORD registry value. The key is created automatically if it doesn’t exist yet.

$cs.Reg_SetDword(string registryroot, string regkey, string regvaluename, int regvaluedata)

Root hive: HKLM/HKEY_LOCAL_MACHINE, HKCU/HKEY_CURRENT_USER, or HKU/HKEY_USERS.

Registry key path, relative to registryroot. Created automatically if it doesn’t exist.

Name of the value to write.

32-bit integer to write.

None.

Terminal window
$cs.Reg_SetDword('HKLM', 'Software\Adobe\Acrobat Reader\DC\AVGeneral', 'bisFirstLaunch', 0)

Writing a feature-flag DWORD during PostInstall so the application enables an optional module on next launch.

Terminal window
$cs.Reg_SetDword('HKLM', 'SOFTWARE\Contoso\AppSuite\Features\Reporting', 'Enabled', 1)
$cs.Job_WriteLog("Enabled the Reporting feature")

Writing a build number as an integer marker so future installs can detect what’s already on the machine.

Terminal window
$cs.Reg_SetDword('HKLM', 'SOFTWARE\Contoso\AppSuite', 'BuildNumber', 4712)

$cs.Reg_SetInteger $cs.Reg_SetQword $cs.Reg_GetInteger