更改计算机名,IP地址;
@echo off
rem 更改计算机名
set /p newname=请输入新计算机名:
wmic computersystem where name="%computername%" call rename name="%newname%"
REM 更改网络设置
set /p ipaddress="请输入新的IP地址: "
set /p subnetmask="请输入新的子网掩码: "
set /p gateway="请输入新的网关: "
set /p dns1="请输入首选DNS服务器: "
netsh interface ipv4 set address name="本地连接" static %ipaddress% %subnetmask% %gateway%
netsh interface ipv4 add dnsserver name="本地连接" address=%dns1% index=1
netsh interface ipv4 add dnsserver name="本地连接" address=%dns2% index=2
echo 完成.
pause