1.

Solve : registery?

Answer»

Hello,

I am trying to create a file that checks the presence of a registery key and if it finds it echo yes.
So FAR I came up with that :


@echo off

if exist "hklm\software\microsoft\windows\currentversion\run" /v "avast" (
echo yes
) else (
echo no
)
pause


Any HELP would be apriciated

AlmnIF EXIST is useful for checking the existence of files but not very useful for REGISTRY keys.

Code: [Select]@echo off
reg query "hklm\software\microsoft\windows\currentversion\run" /v "avast"
if errorlevel 1 (echo no) else (echo yes)

Good luck. 8-)THANK YOU

Almn



Discussion

No Comment Found