以下是我的代码,但它不断给我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
)
)
答案 0 :(得分: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