Registry value per batch editing - Windows XP error
Hello,
I would like the value of a registry keys using a batch file to edit. It already contains and may not be overwritten. They must be maintained and I would like to add something.
The problem is the existing value on each machine is the same, however, it is the added.
I approached the value of the Keys which was reading out it in a store variables and a new variable to define the variables from the old and the new value is composed.
So looking from the batch so far:
Code:
@ echo off
set RegHotfixListe = "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Test"
set HotFixNr =
set new =; Value2
set f =
for / F "delims = \ tokens = 7"%% f in ( 'reg query "% RegHotfixListe%" / v name 2 ^> NUL ^ | findstr "name"') do "%% f"
set HotFixNr =% f%%% new
reg add "RegHotfixListe%%" / v name / t REG_SZ / d "%% HotFixNr" / F
break
Problem is the existing value does not read, or not in the variable will be stored. Find findstr instead, I had already tried initially. So I have the key "test" only "; Value2" and the already existing has been overwritten.
According to research, it should actually do so, but it will not. I am on the boardwalk or the script is just a small mistake?
"Freely you have received, freely give." -- Jesus Christ
Bookmarks