批处理改计算机名 工作组 IP

要求傻瓜式操作
运行后自动将
计算机名改为 A
工作组改为 B
给出的IP为:123.45.67.89
子网掩码:255.0.0.0
默认网关:123.45.67.1

首选DNS:123.456.0.9
备选DNS:123.456.78.9

其他无所谓,只要一运行就把上面的信息改好 就可以
匿名回答者 先谢谢你
你的我试了下
装机后 IP 为自动获取(后来又试了下使用指定IP)

可以自动改计算机名 工作组
但本地连接的内容改不了
@echo off
for /f "tokens=2 delims=:" %%a in ('ipconfig /all^|find "Host Name"') do set pcName=%%a
set pcName=%pcName:~1%
WMIC computersystem where Name="%pcName%" call Rename Name=A

wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name=B

netsh interface IP Set Address "本地连接" Static 123.45.67.89 255.0.0.0 123.45.67.1 1
netsh interface ip set dns name="埋洞本地连接" source=static addr=123.456.0.9
netsh interface ip add dns "本地连接" 123.456.78.9 index=2

网卡的名称需要为“本地连接”,否则无法修改。 另外这个代码的确有点问题,我已经修改了,你行喊再复制弯带枯一次试试吧。
在网络连接里面 把你的连接名改为本地连接就可以了