Using GetReg to get a default registry value

  • 3150565
  • 03-Apr-2008
  • 26-Apr-2012

Environment

Novell SecureLogin 6.x Scripting

Situation

How do you get the default value out of a registry key using GetReg?
Novell Documentation of the GetReg command

5.2.33GetReg

Use With

All

SecureLogin Version

3.5 to 6.1

Type

Action

Usage

GetReg

Arguments

This is the registry entry to read.

This variable defines where to store the retrieved environment variable data.

Description

Use the GetReg command to read data from the registry and save it in the specified.

The following is format for the registry entry input:

HIVE\KEY\Value

ValueValid hives are:

"HKCR" HKEY_CLASSES_ROOT"HKCC"HKEY_CURRENT_CONFIG"HKCU"HKEY_CURRENT_USER"HKLM"HKEY_LOCAL_MACHINE"HKU"HKEY_USERS

Example

Windows Application Definition

GetReg "HKLM\Software\ABCCorp\ProductID"?ProductID
If ?ProductID noteq "xxxxxxxxxx"
#Not corporate desktop
   EndScript
EndIf

Resolution

To get the default value for a registry location, use a Dubble backslash.
Example:
 
GetReg HKLM\Software\ABCCorp\HQ\\
 
This will return the default value set at HQ