Недопустимый параметр mask (192.168.100.123)через собственную командную строку netsh все ок, а вот именно в bat начинает опять не работать.
@echo off
setlocal enabledelayedexpansion
rem Set variable for network interface name
set interface_name=Ethernet
rem Get the local IP address of the computer
for /f "tokens=13 delims=: " %%i in ('ipconfig ^| find /i "IPv4-Адрес" ') do (
set ip_address=%%i
)
rem Set variables for other IPv4 settings
set subnet_mask=255.255.252.0
set gateway=192.168.1.252
rem Set variables for DNS settings
set dns1=192.168.0.100
set dns2=192.168.0.42
rem Execute netsh commands to change the settings
netsh interface ip set address name="%interface_name%" static !ip_address! %subnet_mask% %gateway%
netsh interface ip set dns name="%interface_name%" static %dns1%
netsh interface ip add dns name="%interface_name%" %dns2% index=2
echo Successfully configured IP Address: !ip_address!, Subnet Mask: %subnet_mask%, Gateway: %gateway%, DNS1: %dns1%, DNS2: %dns2%
pause