A
A
ayapergenov2018-09-03 07:01:02
cmd/bat
ayapergenov, 2018-09-03 07:01:02

What is the syntax error of the network card settings change script?

You need to frequently switch network card settings.
Found instructions on Habré
Created a script with encoding for cmd.exe - 866
Put a batch file in the root of drive C: with the label System.

@echo off
set /p mesto="Выберите настройки (1 - EKK, 2 - SUFD): "
echo Выбраны настройки - %mesto%

if %mesto% equ 2 goto EKK

if %mesto% equ 2 goto SUFD

:EKK
set IFACE="local"
set IP=10.42.136.133
set MASK=255.255.255.192
set GATEWAY=10.42.136.129
set GWMETRIC=1
set DNS1=10.42.136.129
set DNS2=104.42.136.129

:SUFD
set IFACE="local"
set IP=192.168.5.133
set MASK=255.255.255.0
set GATEWAY=192.168.5.1
set GWMETRIC=1
set DNS1=192.168.5.1

echo _____
echo Устанавливаем IP адрес-%IP%
echo Маску подсети-%MASK%
echo Основной Шлюз-%GATEWAY%

netsh interface ip set address name=%IFACE% source=static addr=%IP% mask=%MASK% gateway=%GATEWAY% gwmetric=%GWMETRIC%

echo Устанавливаем основной DNS сервер %DNS1%
netsh interface ip set dns name=%IFACE% source=static addr=%DNS1% register=PRIMARY

echo Настройки сети изменены:
ipconfig /all
echo _____
pause

At startup, Cyrillic characters are displayed correctly.
The path is only in Latin.
But I still get the message: "Syntax error for file name, folder name, or volume label."
5b8cb1e2d9dc2433262109.jpeg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question