echo off
set /p cname=请输入计算机名:echo REGEDIT4 >reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName] >> reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName] >> reg.reg
echo "ComputerName"="%cname%" >> reg.regecho [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName] >> reg.reg
echo "ComputerName"="%cname%" >> reg.regecho [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\ComputerName\ComputerName] >> reg.reg
echo "ComputerName"="%cname%" >> reg.regecho [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] >> reg.reg
echo "NV Hostname"="%cname%" >> reg.reg
echo "Hostname"="%cname%" >> reg.regecho [HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\ShellNoRoam] >> reg.reg
echo @="%cname%" >> reg.regecho [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName] >> reg.reg
echo "ComputerName"="%cname%" >> reg.regecho [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters] >> reg.reg
echo "NV Hostname"="%cname%" >> reg.reg
echo "Hostname"="%cname%" >> reg.regecho [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >> reg.reg
echo "DefaultDomainName"="%cname%" >> reg.reg
echo "AltDefaultDomainName"="%cname%" >> reg.regregedit /s reg.reg
pause
set /p IP=请输入IP:
cmd /c netsh interface ip set address name="本地连接" source=static addr=%IP% mask=255.255.0.0 gateway=192.168.10.1 gwmetric=1
cmd /c netsh interface ip set dns name="本地连接" source=static addr=202.96.128.166
cmd /c netsh interface ip add dns name="本地连接" addr=202.96.128.143 index=2
REM 子掩码/网关/DNS请事先设置好!
pauseecho 根据IP自动修改内部网络号
pause
echo off
ipconfig /all | find /I "IP Address">IP_.txt
if errorlevel==1 goto NO
for /f "tokens=15" %%M in (IP_.txt) do set IP=%%M
if errorlevel==1 goto NO
echo REGEDIT4 >reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\NwlnkIpx\Parameters] >>reg.reg
echo "VirtualNetworkNumber"=dword:00000%IP:~11% >>reg.reg
rem 注释:假如你的IP是192.168.0.*的,请修改上面~11%为~10%
regedit /s reg.reg
if errorlevel==1 ( goto NO ) else ( goto YES ):YES
del IP_.txt
del reg.reg
echo 修改内部网络号成功,请按任意键重新启动即可全部生效!
pause
shutdown /r /t 0
exit:NO
del IP_.txt
echo 修改内部网络号失败,请按任意键退出!
pause
exit
2010/04/07
批处理命令行全自动修改计算机名/IP/子掩码/网关/DNS/内部网络号 [转]
订阅:
博文评论 (Atom)
没有评论:
发表评论