The .reg file has two main issues:
- The last registry path is missing the required .reg syntax
- The second key is not actually being created because it is not in square brackets and has no value lines
A valid .reg file must follow this structure:
Windows Registry Editor Version 5.00
[RegistryPath]
"DataItemName"=DataType:DataValue
From the documentation:
- Each registry path must be enclosed in square brackets
[ ].
- Values must be on lines under that path, in the form
"Name"=Type:Value (or "Name"="Value" for REG_SZ).
- Each key or subkey is a new registry path, separated by a blank line.
In the snippet provided:
Windows Registry Editor Version 5.00
; log out and back in if exiting Widows Explorer does not activate after installing this
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}]
@="Recycle Bin"
; For all users:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace
The first key is correct. The second line:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace
is treated as a comment/invalid line, not as a registry key, because:
- It is not enclosed in
[ ].
- There are no value lines under it.
If the intention is to add the Recycle Bin under This PC (My Computer) for all users, the second part must also be a proper key with a GUID subkey and a default value, for example (pattern only, adjust to the desired GUID/location):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}]
@="Recycle Bin"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}]
@="Recycle Bin"
Key points based on the .reg syntax rules:
- Every registry path must be in
[ ].
- The default value is written as
@="Some text" (REG_SZ, no explicit type).
- The file must start with
Windows Registry Editor Version 5.00 and contain blank lines between key blocks.
Without those corrections, the second path does nothing when the .reg file is imported.
References: