码迷,mamicode.com
首页 > Windows程序 > 详细

windows修改计算机名和ip

时间:2018-03-28 17:31:53      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:windows

@echo off echo. echo. echo 自动修改计算机名和ip echo. set /p f=请输计算机的IP后缀(值小于255): set name= test%f% set net=本地连接 3 set ip=192.168.10. set mask=255.255.255.0 set gateway=192.168.10.1 set dns1=114.114.114.114 set dns2=8.8.8.8 reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam" /v @ /t REG_SZ /d "%name%" /f >nul reg add "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName" /v "ComputerName" /t REG_SZ /d "%name%" /f >nul reg add "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v "ComputerName" /t REG_SZ /d "%name%" /f >nul reg add "HKLM\SYSTEM\CurrentControlSet\Services\Eventlog" /v "ComputerName" /t REG_SZ /d "%name%" /f >nul reg add "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName" /v "ComputerName" /t REG_SZ /d "%name%" /f >nul reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t REG_SZ /d "%name%" /f >nul reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "Hostname" /t REG_SZ /d "%name%" /f >nul netsh interface ip set address "%net%" static %ip%%f% %mask% %gateway% netsh interface ip set dns "%net%" static %dns1% primary netsh interface ip add dns "%net%" %dns2% echo 已修改的配置信息如下: echo. echo 计算机名 %name% echo ip %ip%%f% echo 掩码 %mask% echo 网关 %gateway% echo dns1 %dns1% echo dns2 %dns2% echo. echo "计算机名和ip修改成功" pause

windows修改计算机名和ip

标签:windows

原文地址:http://blog.51cto.com/quliren/2092074

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!