.REG files question

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?
 
M

Mike T

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top