Hi Davros, Ronnie Ratt, melee5, hi everybody,Thanks to The Count who gave me the link to your discussion!
>to look at a regedit value and depending on
>if it is a 1 or a 0 run a certain .reg file?
Here's what you need to do:
@echo off
rem Select a specific line from sample.reg file -maybe not useful but you know that '0' and '1' are common!-
type sample.reg|find "IniOem">sample.txt
del sample0.txt
del sample1.txt
type sample.txt|find "0">sample0.txt
type sample.txt|find "1">sample1.txt
if exist sample0.txt file_B.reg
if exist sample0.txt goto quit
if exist sample1.txt file_A.reg
if exist sample1.txt goto quit
echo Error! IniOem not found!
pause
:quit
del sample.txt
del sample0.txt
del sample1.txt
Remarks:
"|" is the "pipe"!
IniOem is just an example... which doesn't contain 0 or 1!!!
I just remind you will extract the 'OemInfo' key from the whole Registry, using line:
start /w regedit /e sample.reg HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\OemInfo
then
type sample.reg|find "IniOem">>reg0.txt
As melee5 states it, I don't know what file_A.reg will do from a batch file... will it only load RegEdit? will it perform the change?
There might be a switch to update... similarly to Regedit /e (which extracts)...
HTH
Have a good day,
Gérard from Paris, France