Page 1 of 1

check registry key [solved]

Posted: 14 Mar 2012 19:15
by abc0502
Is it possible to check for a key in the registry
like in this: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
to check if the "RUN" exist or not

i use this for values:

Code: Select all

@echo off
cls
set reg=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
::===Code===::
REG QUERY "%reg%" /v "utorrent" /s >nul
if %errorlevel%==0 ( echo utorrent Exist
) Else ( echo utorrent Not Exist)

how to check if the "RUN" Key Exist ?? thanks in advance

Re: check registry key

Posted: 14 Mar 2012 19:33
by aGerman
The same way but without the options.

Code: Select all

REG QUERY "%reg%" >nul 2>&1

Check the errorlevel state.

Regards
aGerman

Re: check registry key

Posted: 14 Mar 2012 19:49
by abc0502
Thnaks for the quick respond it work fine :D