• Advertisement
Sign in to follow this  

registry check using .BAT file

This topic is 3655 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I want to check a value in the registry using a batch file...(It is actually checking whether a software is installed or not). If that value exists, i want to quit the batch file. If that value not found, it will execute another .exe from a folder. How this is possible using a batch file........please help me....... Thanks in advance....

Share this post


Link to post
Share on other sites
Advertisement
Something like this seems to work:

@echo off
reg query HKCU\Software\Winamp
if errorlevel 1 goto not_exist
goto exit

:not_exist
program_name_to_run

:exit



Where "HKCU\Software\Winamp\" is obviously the key to query, and program_name_to_run is the name of the program to run if the key doesn't exist.

Although, why do you want to do this from a batch file rather than the exe itself?

Share this post


Link to post
Share on other sites
Googling for 'batch file registry' should give you some ideas. It looks like you'll have to call regedit.exe or reg.exe to do the registry job for you, but what you want seems doable.

EDIT: Beaten to it. :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement