Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm lost here (not at this forum but gotta Problema!)
HOW do I find, SEARCH for and then DISPLAY a specific binary-
or DWORD-value (etc.value) from within the registry and show
the results in the batch from within it runs! (sorry, get
confused Myself) I do know how do Edit (add/rem) spec. values
/keys from a batch BUT how display/ECHO them values on screen
(that of course need to be searched for 1st) ANY IDEAS could
be great! (or confusing, lol:) Please make an realistic example
else I don't get it!! (don't write some general code wich I do
NOT understand! cause I can't relate it to any. If u make great
example I actually then imidiantly then get the basic behind it,
and also much faster really much easier, OK (honest thats true!)
IsIt also possible to have ErrorLevel if found/ or not Found ?
_____________________________________________________
THANX. BatchLearning (yeh I know: rather should try learn English!)

Let's say you have the DWORD value named "MyValue" under the following key:
HKEY_EXAMPLE\Macrosoft
To extract the whole key to a file, you would do:
REGEDIT /E file.dat HKEY_EXAMPLE\Macrosoft
Now that you have the whole key on the file, use FIND to display only the line which contains the value:
FIND "MyValue" < file.dat
Afterwards, delete the temporary file. I recommend using a file under the %TEMP% variable (such as %TEMP%.\file.dat), I simply used file.dat to make it simpler.
That method will display the DWORD name and value, like this:
"MyValue"="string"
If you just want the value, I can do it, though it would require a more complex batch file.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

By the way, FIND will return errorlevel 0 if it finds the string, and errorlevel 1 if it doesn't. So, use it:
REGEDIT /E file.dat HKEY_EXAMPLE\Macrosoft
FIND "MyValue" < file.dat
if errorlevel=1 echo Value not found!In this example, if the value is found it will be displayed, and if it isn't, the message "Value not found!" will be displayed. Look this other one:
REGEDIT /E file.dat HKEY_EXAMPLE\Macrosoft
type file.dat |FIND "MyValue" > file.dat
if errorlevel=1 goto notfound
goto foundAnd then you would have the lables :notfound and :found further on the batch script.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
instal dos on a new hard ...
|
Dos 3.2 boot disk please
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |