jataylor
04-30-2001, 11:01 PM
In a .bat script how do I do a:
IF
hkey_local_machine\....\..\value is xxxx"
THEN
regedit /s Y:\modreg.reg
<P ID="edit"><FONT class="small">Edited by jataylor on 04/30/01 19:04.</FONT></P>
RWSchlatter
05-01-2001, 06:50 PM
moved from Registry to Scripting discussion forum
As you want to use a .BAT, you must first export the value using REGEDIT /E.
You did not give the Win OS version you are using, so J suggest following:
Call EDLIN from within the BAT file, add secondary commands to delete any unnecessary lines in the file, then use a Replace command to replace the registry value name by a DOS SET statement to create a environment variable, last save as a helper BAT file.
CALL the helper BAT file, then you have an environment variable you can use in any IF or GOTO statement.
When using Win2K, there is a set of file parsing options on the FOR statement that may help you.
But as you see, BAT file has always been a bit tricky, why not take the chance and learn WSH scripting, you have direct access to the Registry and a structured language.
______________
Regards - Richard<P ID="edit"><FONT class="small">Edited by RWSchlatter on 05/01/01 15:36.</FONT></P>
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.