0

我想知道如何批量使用 reg 查询来做出 if else 决定

我到目前为止是:

    set ANSWR = ('reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage')

if %ANSWR% == "0415" (goto DUTCH) else (goto OTHER)

:DUTCH
MSG * windows is in dutch

EXIT

:OTHER

MSG * CANT FIND VERSION

EXIT
pause
4

1 回答 1

0

有一些问题,但这是一个可行的

@ECHO off
FOR /f "tokens=3" %%a IN ('reg query^
 "HKLM\SYSTEM\ControlSet001\control\nls\language" /v InstallLanguage') DO (
    SET answer=%%a
) 
IF %answer%==0415 (
    GOTO :DUTCH
) ELSE (
    GOTO :OTHER
)

:DUTCH
MSG * windows is in dutch
GOTO :END

:OTHER
MSG * CANT FIND VERSION
GOTO :END

:END
pause
于 2012-10-11T08:35:15.927 回答