Skip to content

$cs.Reg_SetQword

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

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

64-bit integer to write.

None.

Terminal window
$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.

Terminal window
$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.

Terminal window
$cs.Reg_SetQword('HKLM', 'SOFTWARE\Contoso\AppSuite', 'DeploymentId', 9876543210123)

$cs.Reg_SetDword $cs.Reg_SetInteger $cs.Reg_GetInteger