标题: 批处理修改计算机IP、IPX、计算机名、盘符 [打印本页]
作者: youxi01 时间: 2007-11-9 13:25 标题: 批处理修改计算机IP、IPX、计算机名、盘符
来源于网络。- @echo off
- color 1a
- set 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
- set slection1=
- set slection1=替换你的IP地址:
- netsh interface ip set address name="本地连接" source=static addr=%slection1% mask=255.255.255.0
- set slection2=
- set slection2=替换你的网关地址:
- netsh interface ip set address name="本地连接" gateway=%slection2% gwmetric=0
- set slection3=
- set slection3=替换你的主dns地址
- netsh interface ip set dns name="本地连接" source=static addr=%slection3% register=PRIMARY
- set slection4=
- set slection4=替换你的备份dns地址
- netsh interface ip add dns name="本地连接" addr=%slection4%
- netsh interface ip set wins name="本地连接" source=static addr=none
- for /f "tokens=16 delims=." %%i in ('ipconfig ^| find /i "ip address"') do set netkey=%%i
- REG add "HKLM\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters" /v VirtualNetworkNumber /t REG_DWORD /d %netkey% /f
- set a=替换你需要修改的盘符(如果是f盘,请直接输入f,不能输入f:)
- set b=替换成你修改后的盘符(如果是g盘,请直接输入g,不能输入g:)
- set old=%a%:
- set new=%b%:
- for /f %%i in ('mountvol %old% /l') do set "vol=%%i"
- mountvol %old% /d
- mountvol %new% %vol%
- popd
- echo 工作已完成!!
- ping /n 3 127.1>nul
复制代码
作者: yxw030826 时间: 2010-1-19 17:59
改IP很好用啊
就能不用THINKPAD的ACCESS那个软件了
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |