The command reg add in Windows

The reg add command adds new subkeys or entries to the registry.

The reg add command adds new subkeys or entries to the registry.To learn more about how to use this command, see the example section below.

Syntax reg add command

 reg add [{/ v ValueName | / ve}] [/ t DataType] [/ s Separator] [/ d Data] [/ f] 

The command parameter reg add

Parameters

Describe

 

Specify the full path of the subkey or which entry will be added.To specify a remote computer, attach the computer name (in the format) as part of the KeyName parameter.In addition, the KeyName parameter must also include a valid root key.Valid root keys for local computers are: HKLM, HKCU, HKCR, HKU and HKCC.If the remote computer is specified, the valid original keys will be HKLM and HKU.

/ v

Specify the name of the registry entry to be added under the specified subkey.

/ ve

Specifies that the added entry to the registry will have a null value.

/ t

Only the type of entry to be added, must be one of the following:

REG_SZ

REG_MULTI_SZ

REG_DWORD_BIG_ENDIAN

REG_DWORD

REG_BINARY

REG_DWORD_LITTLE_ENDIAN

REG_LINK

REG_FULL_RESOURCE_DESCRIPTOR

REG_EXPAND_SZ

/S

Specifies the character used to separate multiple data versions when REG_MULTI_SZ data types are specified and multiple entries need to be listed.

/ d

Specify data for the new entry entry.

/ f

Add the register entry without sending a confirmation prompt.

/?

Show help at thecommand prompt.

Reg command comment add

This reg command does not require confirmation when adding a subkey.

The following table lists the return values ​​during the execution of the reg add command:

Value

Meaning

0

Success

first

Failure

For keys of the type REG_EXPAND_SZ, use the caret symbol (^) with% "inside the / d parameter .

Example command reg add

To add HKLMSoftwareMyCo key on the ABC remote computer, type:

REG ADD ABCHKLMSoftwareMyCo

To add an entry to HKLMSoftwareMyCo with a value of type REG_BINARY and data is fe340ead , type:

 REG ADD HKLMSoftwareMyCo / v Data / t REG_BINARY / d fe340ead 

To add the multi-value registry entry to HKLMSoftwareMyCo with the value of MRU , REG_MULTI_SZ data and faxmail data, enter:

 REG ADD HKLMSoftwareMyCo / v MRU / t REG_MULTI_SZ / d faxmail 

To add an extended registry entry for HKLMSoftwareMyCo with a value of Path , data as REG_EXPAND_SZ and data is % systemroot% , enter:

 REG ADD HKLMSoftwareMyCo / v Path / t REG_EXPAND_SZ / d ^% systemroot ^% 

See more:

  1. The qprocess command in Windows
  2. Qappsrv (query termserver) command in Windows
  3. The quser (query user) command in Windows
  4. The pubprn command and the pushprinterconnections command in Windows
3.7 ★ | 7 Vote