$cs.Reg_SetQword
Description
Section titled “Description”Writes a 64-bit REG_QWORD registry value. The key is created automatically if it doesn’t exist yet.
Syntax
Section titled “Syntax”$cs.Reg_SetQword(string registryroot, string regkey, string regvaluename, long regvaluedata)
Parameters
Section titled “Parameters”registryroot (String)
Section titled “registryroot (String)”Root hive: HKLM/HKEY_LOCAL_MACHINE, HKCU/HKEY_CURRENT_USER, or HKU/HKEY_USERS.
regkey (String)
Section titled “regkey (String)”Registry key path, relative to registryroot. Created automatically if it doesn’t exist.
regvaluename (String)
Section titled “regvaluename (String)”Name of the value to write.
regvaluedata (Long)
Section titled “regvaluedata (Long)”64-bit integer to write.
Return value
Section titled “Return value”None.
Example
Section titled “Example”$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.
$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.
$cs.Reg_SetQword('HKLM', 'SOFTWARE\Contoso\AppSuite', 'DeploymentId', 9876543210123)