@ To save the following bat, you can use it.
@echo off
echo is configuring IP, please wait ...
Set name= "Local Area Connection"
Set ipaddress=1.2.3.4
Set mask=255.255.255.0
Set gateway=1.2.3.4
Set dns=1.2.3.4
Set wins=1.2.3.4
Echo is configuring%name%, please wait ...
ECHO is configuring preferred dns:%dns% ...
netsh interface ip set DNS name= "Local Area Connection" Source=static addr=%dns%
ECHO is configuring Standby dns:%wins% ...
netsh interface ip add DNS "Local Area Connection" addr=%wins% index=2
echo is configuring IP, mask, and gateway:%ipaddress%%mask%%gateway% ...
netsh interface ip set address name=%name% source=static addr=%ipaddress% mask=%mask% gateway=%gateway%
Echo IP configuration succeeded!
Echo. & Pause
Alert at DNS stage when a win IP is configured with bat: The configured DNS server does not exist or is not correct. The solution is to put the DNS settings code before the IP address, the estimated reason is that IP first set up, looking for DNS when the monk, have the time to study it well.