system
January 21, 2009, 6:15pm
1
(imported topic written by trickey91)
I’m trying to create a new registry key containing the value of an existing registry key. The most promising entry I’ve found in this group indicates that I should use a parameter:
parameter “atriahome” = “{(value “ProductHome” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Atria\ClearCase\CurrentVersion” of registry as string)}”
regset "
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
" “TEST_ENV”="{parameter “atriahome”}"
However, this doesn’t work.
Any suggestions?
Ron
system
January 21, 2009, 10:39pm
2
(imported comment written by jessewk)
looks like it should work to me. Are you sure that registry key and value exist on your test machine?
system
January 21, 2009, 11:21pm
3
(imported comment written by trickey91)
I figured out the problem…now I just need the solution.
The value of ProductHome is the pathname to a directory. The backslashes are causing the failure. If I change the value to “Test”, then it works.
So… how do you escape backslashes in an unknown value?!
system
January 21, 2009, 11:34pm
4
(imported comment written by trickey91)
Got it.
parameter “origkey” = “{(value “ProductHome” of key “HKLM\SOFTWARE\Atria\ClearCase\CurrentVersion” of registry as string)}”
regset "
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
" “ATRIAHOME”="{escape of parameter “origkey”}"
Thanks,
Ron