.REG files question

  • Thread starter Thread starter adamrobillard
  • Start date Start date
A

adamrobillard

How can I create a .REG file entry that will add to an existing key.
For example, adding a Path to the existing Path without overwriting
it's contents?

-------------------------------------------------------
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Environment]
"MY_KEY"="C:\\Program Files\\My Folder"
"Path"="%MY_KEY%"

So If Path already existed and had "C:\\temp" as it's entry for
example, running this reg file would overwrite the contents of the
current Path and insert the new one. I would like the new path to be
added to the end of the existing path.

Is this possible?
 
You would need to write a script to read the current value, append the
new value to the current value, thus creating a new value with both,
then writing that new value to the key. you may need to use a
scripting language like VBScript.
 
Back
Top