批处理命令 Win XP 修改计算机名 @echo off set /p name=请输您的计算机名: reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f 批处理命令 自定义配置网络IP、网关、DNS @echo off set slection1= set/p slection1=请输入 IP 地址: netsh interface ip set address name="本地连接" source=static addr=%slection1% mask=255.255.255.0 set slection2= set/p slection2=请输入网关地址: netsh interface ip set address name="本地连接" gateway=%slection2% gwmetric=0 set slection3= set/p slection3=请输入主 dns 地址 netsh interface ip set dns name="本地连接" source=static addr=%slection3% register=PRIMARY set slection4= set/p slection4=请输入备份 dns 地址 netsh interface ip add dns name="本地连接" addr=%slection4% netsh interface ip set wins name="本地连接" source=static addr=none pause 根据 MAC 地址自动修改计算机名 2009-9-23 16:21:18 @echo off color 0a setlocal EnableDelayedExpansion title 根据 MAC 地址自动修改计算机名、IP 地址、掩码、网关、DNS(批处理) By Netboy set mask=255.255.255.0 set gateway=192.168.1.1 set DNS1=202.96.128.86 set DNS2=202.96.128.166 echo. echo. 完成获取资料,请检查正确后按确认键开始执行修改任务 echo.************************************************************************* echo. for /f "tokens=2 delims=:" %%M in ('ipconfig /all^|find /i "Physical Address"') do set Mac=%%M echo. 本机 MAC 地址 (硬件获取): %Mac% set PCMAC=%MAC:~ 1% echo. for /f "tokens=1" %%a in ('type MAC.ini^|find /i "%PCMac%"') do (set pcname=%%a) echo 本机计算机名 (动态获取): %pcname% echo. for /f "tokens=2" %%...