0
I need help for verifying if the value for a key exist or not.
I don't know how to check if my specified value name exist or not in my specified Key path.
I have this:
reg add "HKLM\SOFTWARE\....." /v "ARCHIVELOGENABLE" /d "Y"
So, how to check if ARCHIVELOGENABLE
is one of the value names in my Key path?
I have something like this:
@echo off
reg query myKEY > nul
if %ERRORLEVEL% EQU 1 echo (
goto INSTALL
) else (
if (my value name not exist) (
goto INSTALL
) else (
goto SKIP_INSTALL
)
)
--my value name not exist, what should I write here?
Welcome to Super User!You have provided the work you have done before, which is useful; what problem are you running into specifically? – bertieb – 2018-08-27T10:33:27.773
I think I do not understand your question, sorry. – Lia – 2018-08-27T10:44:10.447
I have to register a specified key path with a specified Key value name. I have 3 cases:
I think I need a for iteration for all the values from my Key, but, at this time I am totally confused – Lia – 2018-08-27T10:49:38.587
It is a plausible case that an user want to edit or delete the value name? and the installer should not overwrite it (in edit case) – Lia – 2018-08-27T10:54:15.437
Apologies for not being clear before. Where you have said "I need help", with what do you need help? For example, do you have error messages? Unexpected behaviour of your script? – bertieb – 2018-08-27T10:56:33.747
I don't know how to check if my specified value name exist or not in my specified Key path – Lia – 2018-08-27T11:05:17.500
I have this: reg add "HKLM\SOFTWARE....." /v "ARCHIVELOGENABLE" /d "Y" – Lia – 2018-08-27T11:06:03.673
so, how to check if ARCHIVELOGENABLE is one of the value names in my Key path? – Lia – 2018-08-27T11:07:07.890
Please edit your question and update it with the details we have discussed.
– bertieb – 2018-08-27T11:46:28.097reg query "HKLM\SOFTWARE....." /v "ARCHIVELOGENABLE". If it doesn't exist %ERRORLEVEL% = 1 – Hardoman – 2018-08-27T11:56:23.067