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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
usuallyresourceful
Posts: 2
Joined: 15 Jan 2014 16:23

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

#1 Post by usuallyresourceful » 15 Jan 2014 16:39

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.

Squashman
Expert
Posts: 4198
Joined: 23 Dec 2011 13:59

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

#2 Post by Squashman » 15 Jan 2014 17:32

What code page are you using?

Squashman
Expert
Posts: 4198
Joined: 23 Dec 2011 13:59

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

#3 Post by Squashman » 15 Jan 2014 18:47

Squashman wrote:What code page are you using?

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

carlos
Expert
Posts: 501
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

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

#4 Post by carlos » 15 Jan 2014 19:53

hello, try use instead the trademark the ? symbol

usuallyresourceful
Posts: 2
Joined: 15 Jan 2014 16:23

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

#5 Post by usuallyresourceful » 15 Jan 2014 20:47

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.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

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

#6 Post by Dos_Probie » 16 Jan 2014 05:23

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"

carlos
Expert
Posts: 501
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

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

#7 Post by carlos » 16 Jan 2014 16:16

try this:

Code: Select all

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

Post Reply