Best Ways to Modify REG_SZ Key in 2022

REG_SZ Key

The Windows Registry contains objects called values that refer to specific instructions in the operating system. These objects can be accessed by entering their respective key and subkey.

Without any fuss, let’s get started to know REG_SZ Key!

Contents

What are Registry Keys?

Registry Keys are simply a Windows registry item that stores the values of the Windows Registry. It contains the values that are stored in the directory, just like files in the Windows Registry.

What is a REG_SZ Key?

The “null-terminated” string value comprising REG_SZ Key is a type of registry value that refers to specific instructions in Windows. The registry is organized in keys and subkey locations. Each key and subkey contains a variety of entries, including data types, names, and values. You can modify or remove these entries by clicking the Registry Editor.

The registry key name has a maximum size of 255 characters. It contains information about the various features of the operating system, such as the profiles for each user and the types of documents that can be created.

Where are they stored?

Registry values can be found in the various locations of Windows in its different operating systems (Windows 11/10/87/Vista/XP).

Registry values can also be found in the registry hives and the registry keys. Aside from registry keys (REG_SZ Key) and registry hives, the objects that appear in the Registry Editor are also called folder and registry values. They contain information about the various registry keys and their “subkeys“.

Registry Editor
Registry Editor

Key Notes to Make:

  • When selecting a subkey, the values will appear on the right-hand side of the Registry Editor.
  • There have been some changes in how registry keys are collapsed and expanded, but these did not affect the main function of the registry keys.

What are the Types of Registry Values?

Each type of registry value has its purpose. Some are commonly used to represent regular letters and numbers:

String Values

Each string value has a different purpose and can be used for a different reason. For instance, if the string value is located in the Windows Registry, it may be used to point to a path to a file or folder, or it may be used to describe a system tool. You can find string values inside the Registry Editor as REG_SZ.

String Value: REG_SZ Key
String Value: REG_SZ Key

Multi-String Values

A multi-string value is a type of string value that can contain a list of values. It’s similar to a string value except that instead of just one line, they have a list of values. Some multi-string values can only have one entry. It is not the same as REG_SZ Key, but you can find multi-string values inside the Registry Editor as REG_MULTI_SZ.

Multi_String Value: REG_MULTI_SZ Key
Multi_String Value: REG_MULTI_SZ Key

Expandable String Values

It is the same as Multi-String Values but with variables. When a registry value is called by a Windows program, its values are expanded to what the variable defines. Mainly, it is identified in Registry Editor by its % signs. A type Registry Editor lists, i.e., expandable string values, are the “REG_EXPAND_SZ” registry key.

Expandable String Value: REG_EXPAND_SZ Key
Expandable String Value: REG_EXPAND_SZ Key

Binary Values

Registry values written in binary format can be found in the program’s icons. They are also commonly referred to as binary values. The icons in Registry Editor show zeros and ones. It is a REG_BINARY registry key.

Binary Value: REG_BINARY Key
Binary Value: REG_BINARY Key

DWORD (32-bit) Values & QWORD (64-bit) Values

The DWORD (32-bit) and QWORD (64-bit) values can be expressed in either hexadecimal or decimal format. They can also be created in either 32-bit or 64-bit mode.

DWORD (32-bit) Values & QWORD (64-bit) Values: REG_DWORD & REG_QWORD
DWORD (32-bit) Values & QWORD (64-bit) Values: REG_DWORD & REG_QWORD

Both 32-bit and 64-bit registry values can be created with this feature. In Registry Editor, you can see which DWORD and QWORD values are used for each type of registry entry.

Add REG_SZ Key in 3 Easy Steps Using Registry Editor

Regardless of the reason why you’re installing it or how it was previously set up, here’s how you can add new values and keys to the registry. You need to follow the three simple steps to add a new reg_sz key to your system.

  • Open up Registry Editor (regedit.exe)and then go to the key with the REG_SZ value.
Registry Editor (regedit.exe)
  • By Right-clicking in the right-hand panel, navigate to New and select the type of Registry value that you want to select.
Adding New REG_SZ Key
Adding New REG_SZ Key
  • Lastly, Save it using the desired name.
  • You can also modify the Value Data.
  • Reboot/Restart your PC in normal/safe mode.

Modify (Delete/Rename) REG_SZ Key

If you’re a Windows user, then it’s going to be convenient for you to modify any registry key stored on your computer using the below methods:

Delete Registry Key

  1. Open up the Regustry Editor by searching “regedit” in the Search bar of the task bar.
  2. Permit it to make necessary changes on your PC.
  3. Navigate to the registry key in the Register Editor which needs to be modified.
  4. By right-clicking onto your desired reg_sz – key, you will see an Confirm Value Delete window.
  5. Select Yes to delete the following key from the trajectory inside the Registry Editor.
  6. Reboot/Restart your PC in normal/safe mode.
Delete Registry Key

Rename Registry Key

  • Right-click or tap-and-hold the Registry Key and then select Rename give it a new name.
  • Right-click or tap-and-hold the Registry Value and then select Rename give it a new name.
  • Right-click or tap-and-hold the Value to change its data and then select Rename give it a new name and then choose Modify to assign a new Value data and then confirm with OK.
  • Reboot/Restart your PC in normal/safe mode.
Rename Registry Key

NOTE – Although it’s safe to open a registry value, not knowing about what you’re doing could affect the integrity of the data in the registry. Editing registry values without understanding what you’re doing is always a terrible idea.

Add REG_SZ Key Using Windows Powershell

The registry keys are simply directories that are used to store information in a Windows system. The following cmdlet will create them bypassing the new-item command.

New-Item -Path "<Path>" -Name "<name-of-the-key>"

The registry keys can be assigned to specific properties through a cmdlet. The New-ItemProperty cmdlet can be used to specify the registry keys’ values using the following command.

New-ItemProperty -Path "<Path-of-the-key>" -Name "<name-of-parameter>" -Value "<value-of-the-parameter>"

Example: To Create a REG_SZ Key in HKEY_CURRENT_USER

Use New-Item to Create REG_SZ Key

This example shows how to create a registry key for a current hive user with a new item named “toolspond” at a location “HKCU:\ “.

New-Item -Path "HKCU:" -Name "toolspond"

Create New-Item: Windows Powershell (Administrator)
Windows Powershell (Administrator)

Assign Property Value to REG_SZ Key

The registry key must also have a property value. The following command will assign a parameter named “toolspondpara” and a value “val” to the registry key “toolspond”.

New-ItemProperty -Path "HKCU:\toolspond" -Name "toolspondpara" -Value "val"  -PropertyType "String"

Assign Property Valur: Windows Powershell (Administrator)
Windows Powershell (Administrator)

The newly created REG_SZ key and its corresponding values can be acquired via a graphical user interface (GUI).

The newly created REG_SZ key and its corresponding values can be acquired via a graphical user interface (GUI).

Remove REG_SZ Key Using Windows Powershell

Since the information about the programs and drivers of your operating system resides there, it is susceptible and should be removed. To remove the registry key, execute the following command.

Remove-Item -Path "<path-of-the-key>" -Recurse

Example: To Remove a REG_SZ Key in HKEY_CURRENT_USER

Use Remove-Item to Remove REG_SZ Key

This example shows how to create a registry key for a current hive user with a new item named “toolspond” at a location “HKCU:\ “.

Remove-Item -Path "HKCU:\toolspond" -Recurse

Use Remove-Item to Remove REG_SZ Key
Use Remove-ItemPropertry to property of a REG_SZ Key only

Use Remove-ItemPropertry to property of a REG_SZ Key only

To remove a property of a REG_SZ Key, then you can run following the command displayed below:

Remove-ItemProperty -Path "<path-of-the-key>" -Name "<Name-of-the-property>"

remove a property of a REG_SZ Key
 REG_SZ Key only

FAQs Related to REG_SZ Key

What are the types of REG_SZ Keys in Windows OS?

There are 5 types of registry keys: HKEY_CLASSES_ROOT (HKCR), HKEY_CURRENT_USER (HKCU), HKEY_LOCAL_MACHINE (HKLM), HKEY_USERS (HKU), and HKEY_CURRENT_CONFIG.

What is the maximum size for registry values and characters in names stored within a registry key?

The maximum size of all registry entries is specified to be 64 kilobits and 255 characters, respectively.

Should I backup REG_SZ keys before any modification?

Don’t skip this step, as doing so will restore the previously saved settings in the Windows Registry. Doing so is super easy if you backed up all of the files and settings that were previously saved.

Conclusion

The SZ suffix in REG_SZ is used for the “string, zero-terminated strings” Key. It refers to a string that contains the last valid character before the end of the string. Although it doesn’t have a data type descriptor, REG_SZ does not store the last character of the string. We have also learned to modify REG_SZ Key using Registry Editor and Windows Powershell.

I hope you find this article informative and helpful.

If you have any queries regarding the reg_sz key in the comment box below, you can ping us.

Keep reading and learning!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top