how to find a key or data in regedit

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Mohammad_Dos
Posts: 84
Joined: 08 Sep 2010 10:25
Location: Iran,Kashan
Contact:

how to find a key or data in regedit

#1 Post by Mohammad_Dos » 14 Aug 2011 08:23

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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: how to find a key or data in regedit

#2 Post by aGerman » 17 Aug 2011 13:25

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

Post Reply