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?
Re: Registry value per batch editing - Windows XP error
Easy way: just try out, if you're in reg query "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Test" | findstr "name" ever get out the value that you are looking for. I'm getting there even with no value back.
With reg query "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \" Although I get a lot of information, but I've no subkey with the name test. Use I think so: | find / i "name" I get a result back, at least in the Reg-Key, where I just try.
Re: Registry value per batch editing - Windows XP error
Code:
C: \ WINDOWS> reg query "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVe
rsion \ Test "| findstr" name "
name REG_SZ; Nokia
C: \ WINDOWS>
I have the keys and key extra-created course, as exists in Windows do not. find / i is the same.
So I have read the works already, but the saving is in the variable.
Re: Registry value per batch editing - Windows XP error
What do you want to
achieve?
How about
Code:
for / F "delims = \ tokens = 7"%% f in ( 'reg query "% RegHotfixListe%" / v name 2 ^> NUL ^ | findstr "name"') do (
set HotFixNr =% f%%% new