Comma In Reg File

  • Thread starter Thread starter Barney
  • Start date Start date
B

Barney

How can I add a string value to the registry in a .reg
file if the string ends in a comma?

For example, say I have a .reg file something like . . .

[HKEY_LOCAL_MACHINE\SOFTWARE\....]

"MyVariable"="MyValue,"

The comma is stripped out when the reg file is imported.
Do I have to escape it?
 
Are you sure there isn't something else going on here? The comma doesn't
get stripped for me. I tried it on an XP machine as well as a Windows 2000
Server machine. The way I tested was to manually create a value in regedit,
export the key, delete the key, and merge the .reg file. All went through
fine. Here are the contents of my .reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\temp]
"test"="something with a comma,"

Ray at work
 
It seems that you are correct Ray - thanks.

It works fine on every other PC but mine. I will
investigate further.
-----Original Message-----
Are you sure there isn't something else going on here? The comma doesn't
get stripped for me. I tried it on an XP machine as well as a Windows 2000
Server machine. The way I tested was to manually create a value in regedit,
export the key, delete the key, and merge the .reg file. All went through
fine. Here are the contents of my .reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\temp]
"test"="something with a comma,"

Ray at work

How can I add a string value to the registry in a .reg
file if the string ends in a comma?

For example, say I have a .reg file something like . . .

[HKEY_LOCAL_MACHINE\SOFTWARE\....]

"MyVariable"="MyValue,"

The comma is stripped out when the reg file is imported.
Do I have to escape it?


.
 
In said:
It seems that you are correct Ray - thanks.

It works fine on every other PC but mine. I will
investigate further.

Ensure the comma is inside the enclosing dbl-quotes that define the
string data.

-----Original Message-----
Are you sure there isn't something else going on here? The comma doesn't
get stripped for me. I tried it on an XP machine as well as a Windows 2000
Server machine. The way I tested was to manually create a value in regedit,
export the key, delete the key, and merge the .reg file. All went through
fine. Here are the contents of my .reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\temp]
"test"="something with a comma,"

Ray at work

How can I add a string value to the registry in a .reg
file if the string ends in a comma?

For example, say I have a .reg file something like . . .

[HKEY_LOCAL_MACHINE\SOFTWARE\....]

"MyVariable"="MyValue,"

The comma is stripped out when the reg file is imported.
Do I have to escape it?


.
 
You can try entering your data the way you want it directly in the registry
editor and then exporting that key. Compare that file with the one you're
trying to merge and see if you notice any differences.

Ray at home
 
Back
Top