Share via


reg

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

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.

; *******************************************
; 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

See Also

Reference

Environment Commands