0

以下是我的代码,但它不断给我error: else was unexpected at this time.

@echo on
:Install_Language
reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage | FIND "0409"
    IF %ERRORLEVEL% == 0 (
        Echo English
        ) else (
    reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage | FIND "040c"
    IF %ERRORLEVEL% == 0 (
        Echo French 1
        )
    )   else (
            reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage | FIND "0C0C"
        IF %ERRORLEVEL% == 0 (
        Echo French2
        )
    )   
4

1 回答 1

0

据我所知,其中只有一个是正确的,所以这应该可行。

@echo on
:Install_Language
reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage | FIND "0409" > nul && Echo English
reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage | FIND "040c" > nul && Echo French 1
reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage | FIND "0C0C" > nul && Echo French2
于 2013-05-27T22:33:45.307 回答