# $cs.Reg_SetQword

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

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

### Description

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

### Syntax

$cs.Reg_SetQword(string registryroot, string regkey, string regvaluename, long 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 (Long)

64-bit integer to write.

### Return value

None.

### Example

**PowerShell**

```powershell
$cs.Reg_SetQword("HKLM", "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib", "First Counter", 5)
```

Writing an install timestamp as 64-bit ticks, so later scripts can calculate how long ago the application was installed.

```powershell
$cs.Reg_SetQword('HKLM', 'SOFTWARE\Contoso\AppSuite', 'InstallTimestamp', [DateTime]::UtcNow.Ticks)
$cs.Job_WriteLog("Recorded install timestamp")
```

Writing a large numeric marker that exceeds the 32-bit range a DWORD could hold, such as a unique deployment identifier.

```powershell
$cs.Reg_SetQword('HKLM', 'SOFTWARE\Contoso\AppSuite', 'DeploymentId', 9876543210123)
```

### Related functions

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