Set Registry Value
Verb:
SV
Description:
Sets a single registry value.
Note: Certain registry keys may be locked by the OS and interfere with SV operations. Please verify with the device manufacture that the registry value is not locked.Registry value changes will not be persistent unless the device is rebooted using one of the following:
- RB (reboot) command
- Right-click reboot
- Manual operation
Support:
- XPe Usage
- Continue if Script Command Fails: No
- Arguments:
- The full path of the registry key, including the registry entry name
- The value to set the registry entry to
- The registry type to use for argument #2. Currently only REG_SZ (string) and REG_DWORD (number) are supported. [Optional] <![endif]>
- Examples:
- SV "HKEY_LOCAL_MACHINE\SOFTWARE\Rapport\hAgent\TestValue1" "5551234" Possible scenarios:
- TestValue1 already exists as a REG_SZ and will be set to string "5551234"
- TestValue1 already exists as a REG_DWORD and will be set to the number 5551234
- TestValue1 already exists as another type and the agent will return an error
- TestValue1 doesn't exist and will be set to string "5551234"
- SV "HKEY_LOCAL_MACHINE\SOFTWARE\Rapport\hAgent\TestValue2" "StringValue"
Possible scenarios:
- TestValue2 already exists as a REG_SZ and will be set to string "StringValue"
- TestValue2 already exists as another type and the agent will return an error
- TestValue2 doesn't exist and will be set to string "StringValue"
- SV "HKEY_LOCAL_MACHINE\SOFTWARE\Rapport\hAgent\TestDWORD" "2833" "REG_DWORD"
Possible scenarios:
- TestDWORD already exists as a REG_DWORD and will be set to the number 2833
- TestDWORD already exists as another type and the agent will return an error
- TestDWORD doesn't exist and will be set to the number 2833
- SV "HKEY_LOCAL_MACHINE\SOFTWARE\Rapport\hAgent\TestString" "MyString" "REG_SZ"
Possible scenarios:
- TestString already exists as a REG_SZ and will be set to string "MyString"
- TestString already exists as another type and the agent will return an error
- TestString doesn't exist and will be set to string "MyString"
- CE Usage
- Continue if Script Command Fails: No
- Arguments:
- Description
- The full path of the registry key, including the registry entry name
- The value to set the registry entry to
- The registry type to use for argument #2. Currently only REG_SZ (string) and REG_DWORD (number) are supported. [Optional] <![endif]>
- Examples:
- SV "HKEY_LOCAL_MACHINE\SOFTWARE\Rapport\hAgent\TestValue1" "5551234" Possible scenarios:
- TestValue1 already exists as a REG_SZ and will be set to string "5551234"
- TestValue1 already exists as a REG_DWORD and will be set to the number 5551234
- TestValue1 already exists as another type and the agent will return an error
- TestValue1 doesn't exist and will be set to string "5551234"
- SV "HKEY_LOCAL_MACHINE\SOFTWARE\Rapport\hAgent\TestValue2" "StringValue"
Possible scenarios:
- TestValue2 already exists as a REG_SZ and will be set to string "StringValue"
- TestValue2 already exists as another type and the agent will return an error
- TestValue2 doesn't exist and will be set to string "StringValue"
- SV "HKEY_LOCAL_MACHINE\SOFTWARE\Rapport\hAgent\TestDWORD" "2833" "REG_DWORD"
Possible scenarios:
- TestDWORD already exists as a REG_DWORD and will be set to the number 2833
- TestDWORD already exists as another type and the agent will return an error
- TestDWORD doesn't exist and will be set to the number 2833
- SV "HKEY_LOCAL_MACHINE\SOFTWARE\Rapport\hAgent\TestString" "MyString" "REG_SZ"
Possible scenarios:
- TestString already exists as a REG_SZ and will be set to string "MyString"
- TestString already exists as another type and the agent will return an error
- TestString doesn't exist and will be set to string "MyString"
General Rules:
- The name of the registry hive should not be abbreviated.
- If three arguments are supplied then the agent will either create non-existing keys of the supplied type, or error out if the type does not match an existing key's type.
- If only two arguments are supplied and the key does not already exist then the type REG_SZ (string) is assumed.
- If only two arguments are supplied and the key does exist and it is of type REG_DWORD then the agent will confirm the value is a number and set it as a DWORD.