1

This is my code:

@echo off

echo Checking 32bit registry.
REG QUERY "HKLM\Software\EA GAMES\NFSMW" /v InstallDir >nul
If %ERRORLEVEL% == 0 goto CHECKEND
If %ERRORLEVEL% == 1 goto CHECK64

:CHECK64
echo Checking 64bit registry.
REG QUERY "HKLM\Software\Wow6432Node\EA GAMES\NFSMW" /v InstallDir >nul
If %ERRORLEVEL% == 0 goto CHECKEND
If %ERRORLEVEL% == 1 goto CLOSE

:CHECKEND
echo Registry key was found. Preparing uninstall...

:CLOSE
pause
exit

And my question is: How can i hide ERROR: The system was unable to find the specified registry key or value. if the key was not found?

Greetings.

Damian Silent
  • 215
  • 3
  • 13

1 Answers1

2
REG QUERY "HKLM\Software\EA GAMES\NFSMW" /v InstallDir >nul 2>&1

and

REG QUERY "HKLM\Software\Wow6432Node\EA GAMES\NFSMW" /v InstallDir >nul 2>&1

is hiding that output.

User8461
  • 366
  • 2
  • 14