Page 1 of 1

how to find a key or data in regedit

Posted: 14 Aug 2011 08:23
by Mohammad_Dos
Hi there
I want to find a data in regedit. for example "ApplicationDescription"

it will find in this key:
HKEY_LOCAL_MACHINE\SOFTWARE\KMPlayer

i want to make a directory with name of its key :"KMPlayer"

second question:
i want to search a key in regedit. if it exist do some works and if it not exist do some works else

Re: how to find a key or data in regedit

Posted: 17 Aug 2011 13:25
by aGerman
It's a bit confusing to me.

Try something like that:

Code: Select all

@echo off

for /f "tokens=3" %%a in ('reg query "HKLM\SOFTWARE\KMPlayer" /v "ApplicationDescription" /s^|findstr /ic:"ApplicationDescription"') do (
  set "data=%%a"
)

if defined data (
  echo Data of ApplicationDescription is %data%.
) else (
  echo Key ApplicationDescription not found.
)

pause


Regards
aGerman