# $cs.Reg_SetDword

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

Source: https://docs.capaone.com/capainstaller/powerpacks/cs-reg-setdword/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

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

### Syntax

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

### Parameters

#### registryroot (String)

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

#### regkey (String)

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

#### regvaluename (String)

Name of the value to write.

#### regvaluedata (Integer)

32-bit integer to write.

### Return value

None.

### Example

**PowerShell**

```powershell
$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.

```powershell
$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.

```powershell
$cs.Reg_SetDword('HKLM', 'SOFTWARE\Contoso\AppSuite', 'BuildNumber', 4712)
```

### Related functions

[$cs.Reg_SetInteger](/capainstaller/powerpacks/cs-reg-setinteger/) [$cs.Reg_SetQword](/capainstaller/powerpacks/cs-reg-setqword/) [$cs.Reg_GetInteger](/capainstaller/powerpacks/cs-reg-getinteger/)
