这是我的代码:
@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
我的问题是:如何隐藏错误:系统无法找到指定的注册表项或值。如果找不到密钥?
问候。
答案 0 :(得分:2)
REG QUERY "HKLM\Software\EA GAMES\NFSMW" /v InstallDir >nul 2>&1
和
REG QUERY "HKLM\Software\Wow6432Node\EA GAMES\NFSMW" /v InstallDir >nul 2>&1
正在隐藏该输出。