Page 1 of 1

Reg add in batch not working w/ trademark symbol in path.

Posted: 15 Jan 2014 16:39
by usuallyresourceful
I have been cruising the forums and the internet. I cannot figure out how to write this value to the registry if I have the trademark symbol in the path.

reg add "HKCU\Software\TESTKEY\TESTKEY2®\Global" /v TESTVALUE /t REG_DWORD /d 0 /f

The output; as seen below shows that the trademark symbol is replaced with redirection symbols.

C:\Program Files (x86)\TEST>reg add "HKCU\Software\TESTKEY\TESTKEY2«\Global" /v TESTVALUE /t REG_DWORD /d 0 /f
The operation completed successfully.

Looking for some insight and help on this one. Thanks.

Re: Reg add in batch not working w/ trademark symbol in path

Posted: 15 Jan 2014 17:32
by Squashman
What code page are you using?

Re: Reg add in batch not working w/ trademark symbol in path

Posted: 15 Jan 2014 18:47
by Squashman
Squashman wrote:What code page are you using?

I think I can answer that myself. You are probably using 1252.

Re: Reg add in batch not working w/ trademark symbol in path

Posted: 15 Jan 2014 19:53
by carlos
hello, try use instead the trademark the ? symbol

Re: Reg add in batch not working w/ trademark symbol in path

Posted: 15 Jan 2014 20:47
by usuallyresourceful
Thank you for the replies. I am doing some research into everything that was metioned.

I did not specify a codepage in in my batch file. Google says default Windows 7 x64 codepage is 850. I did try 65001 from a Google suggestion.

I did try to use the ? symbol, but the registry key and output in the command prompt came out as the same ? symbol.

Re: Reg add in batch not working w/ trademark symbol in path

Posted: 16 Jan 2014 05:23
by Dos_Probie
Instead of doing a reg add from commandline you could do a reg import to the temp first then import it over like so..
DP 8)

Code: Select all

@Echo Off
> "%Tmp%\~trademark.reg" Echo Windows Registry Editor Version 5.00
>> "%Tmp%\~trademark.reg" Echo.
>> "%Tmp%\~trademark.reg" Echo [HKEY_CURRENT_USER\Software\TESTKEY\TESTKEY2®]
>> "%Tmp%\~trademark.reg" Echo [HKEY_CURRENT_USER\Software\TESTKEY\TESTKEY2®\Global]
>> "%Tmp%\~trademark.reg" Echo "TESTVALUE"=dword:00000000
Start /Wait Regedit /s "%Tmp%\~trademark.reg"
Del "%Tmp%\~trademark.reg"

Re: Reg add in batch not working w/ trademark symbol in path

Posted: 16 Jan 2014 16:16
by carlos
try this:

Code: Select all

chcp 1252
reg add "HKCU\Software\TESTKEY\TESTKEY2®\Global" /v TESTVALUE /t REG_DWORD /d 0 /f