Hello,
I am facing a simple problem to which I am unable to find a simple answer although I have a strong hunch the solution is simple.
I have a value defined in the registry key
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\Parameters]
The value is a variable VAR_1 = -Xmx332m (REG_SZ)
What I wanted to do is read this variable value into this registry key
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
The whole problem occurs because I have to do this trick from a windows batch file.
Here are the few aprroaches I have in front of me -
1. Export the registry key , do a file string replace and import it back. The con the exported .reg file is not in the same encoding format as a txt file, so I cant search and replace easily. Also, the file search and replace is unnecessarily complex in Windows.
2. Echo the registry value in command prompt and have it in a temp variable and then use that to add a new variable in the registry. Again, this is difficult as when I echo the registry value, windows doesnt give me only the value but also other strings that make it difficult to parse through it.
Does any one have encountered a similar task before. ? I badly need to find out if there is a simple solution for this.
Thanks for the help.
Anand