Check if key exists
Posted: 04 Jun 2008 16:14
Hallo,
I'd like to check whether the key exists.
This example works, but prints error and I can't hide it.
I tried it using the FIND in following script.
Works for .php but so as .php3, .phps, ... (.php*).
How can I check check whether just a "HKEY_CLASSES_ROOT\.php" exists?
Thank you.
I'd like to check whether the key exists.
Code: Select all
REG QUERY HKEY_CLASSES_ROOT\.php >>null
IF ERRORLEVEL 1 ECHO not found
This example works, but prints error and I can't hide it.
I tried it using the FIND in following script.
Code: Select all
REG QUERY "HKEY_CLASSES_ROOT" | FIND /i ".php"
IF ERRORLEVEL 1 ECHO not found
Works for .php but so as .php3, .phps, ... (.php*).
How can I check check whether just a "HKEY_CLASSES_ROOT\.php" exists?
Thank you.