You can simply search for one or the other value with FIND or FINDSTR and invoke commands depending on the search result. The template will look like this:
REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v EnableLUA | ( FIND "0x1" >NUL ) && ( command(s)_to_run_when_UAC_is_enabled ) || ( command(s)_to_run_when_UAC_is_disabled )
those. REG produces an output signal that is passed using pipe ( | ) to the FIND input. FIND searches for 0x1 at its input and, depending on the search result, one of the following blocks of commands enclosed in parentheses is executed.
command && command || command command && command || command is a standard mechanism that allows you to selectively run commands, something like replacing IF . The first command gives the result. The command immediately after && starts if the result is โsuccessโ and the team immediately after || starts in case of failure.
If you need to perform actions in both cases, use both && and || after the command generating the result, but if you need to respond to only one type of result, you can leave either && or || .
source share