Question: how to check if registry key exists?
Answer: How do I check if a key is present in the Windows registry? This can be done using reg query key : errorlevel=0 means the key exists. errorlevel=1 means the key does not exist.
How do I add a key to the windows registry? To add a key if it is not present use reg add key .
Example batch file.