Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
Other versions of this page are also available for the
following:
8/28/2008
This command returns a string representing the contents of a registry value on the client.
Syntax
reg [ key ] [ value ] |
Parameters
- key
-
The registry key containing the value of interest.
- value
-
Name of the value of interest.
Example Code
The following example shows how you can use the command to examine a registry key in a conditional statement.
Copy Code | |
---|---|
; ******************************************* ; retrieving registry values ; ******************************************* if string `reg "HKEY_LOCAL_MACHINE\Comm\ApplicationDownload" "Version"` == "1.09.3615.1008" echo "correct client version" else echo "wrong client version!!" endif |
Remarks
This command outputs a string representing the contents of a particular registry value and is typically used within backticks ( ` ) to perform command substitution.
Do not use the abbreviated versions of base registry keys with this command. The valid base keys are:
- HKEY_CURRENT_USER
- HKEY_CLASSES_ROOT
- HKEY_LOCAL_MACHINE
- HKEY_USERS