epoddubniy
08-10-2021, 12:48
Здравствуйте. В зависимости от имени введенной переменной в пакетном файле, необходимо, чтобы интерпретатор переходил на ту или иную метку.
Но почему-то не переходит.
Помогите пожалуйста разобраться
echo vvedi skip, esli ne nuzhno menyat ip ili go, esli nuzhno
set /p NextStep=
if "%NextStep%" neq "go" call :skip
call :go
:go
chcp 1251
ipconfig
netsh interface show interface
set /p "interface="
set /p "ipstatic="
set /p "mask="
set /p "gateway="
set /p "dns="
call "1.5 ChangeIPMaual2" %interface% %ipstatic%
netsh interface ip set address name="%interface%" static %ipstatic% %mask% %gateway%
netsh interface ip set dns "%interface%" static %dns%
netsh interface ip add dns "%interface%" 0.0.0.0
echo ESLI NAZHMESH KNOPKU IP AUTO BUDET POLUCHEN
pause
netsh interface ip set address "%interface%" dhcp
netsh interface ipv4 set dns name="%interface%" dhcp
ncpa.cpl
pause
exit /b
:skip
echo konec
exit /b
вне зависимости от значения переменной NextStep переходит на метку :go
Но почему-то не переходит.
Помогите пожалуйста разобраться
echo vvedi skip, esli ne nuzhno menyat ip ili go, esli nuzhno
set /p NextStep=
if "%NextStep%" neq "go" call :skip
call :go
:go
chcp 1251
ipconfig
netsh interface show interface
set /p "interface="
set /p "ipstatic="
set /p "mask="
set /p "gateway="
set /p "dns="
call "1.5 ChangeIPMaual2" %interface% %ipstatic%
netsh interface ip set address name="%interface%" static %ipstatic% %mask% %gateway%
netsh interface ip set dns "%interface%" static %dns%
netsh interface ip add dns "%interface%" 0.0.0.0
echo ESLI NAZHMESH KNOPKU IP AUTO BUDET POLUCHEN
pause
netsh interface ip set address "%interface%" dhcp
netsh interface ipv4 set dns name="%interface%" dhcp
ncpa.cpl
pause
exit /b
:skip
echo konec
exit /b
вне зависимости от значения переменной NextStep переходит на метку :go