下面的可用吗?- @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="新的电脑名称写在这里"
- wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="新的工作组名称写在这里"
- echo netsh interface IP Set Address "本地连接" Static IP地址 子网掩码 网关
- echo netsh interface ip set dns name="本地连接" source=staticaddr=主DNS
- echo netsh interface ip add dns "本地连接" 副DNS index=2
复制代码
|