我的批处理脚本只是似乎跳过了我,如果其他部分...也许它只是死了......我不知道......Windows批处理忽略的if else
这是为什么?
@echo on
echo Welche URL soll in Chrome geoeffnet werden? (Enter = lamp.dev)
echo Die URL bitte ohne http/https
echo.
set /p url=URL:
pause
IF %url="" (
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://lamp.dev --new-window "https://lamp.dev"
)ELSE(
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://%url% --new-window "https://%url%"
)
pause
变量需要被封闭在百分号,而不是仅仅的佼佼者。相等的比较运算符是'=='。如果一方被引用,另一方需要引用。更好地使用'如果已定义的url'来测试是否设置了var。否则需要围绕它的空格')否则('。没有坚定的语法你的标题看起来不合适 – LotPings