×

cmd 更改计算机名

hqy hqy 发表于2022-11-12 10:32:24 浏览334 评论0

抢沙发发表评论

bat  更改计算机名

不用重启电脑就生效

 


@Echo off
Color 0A
title ……更改计算机名
:A
cls
echo.
echo.    [0]退出 
echo.
echo.    不用重启电脑就生效^_^ echo.
echo.    必须以管理员身份运行 !
echo.
echo.
set /p pc=       [输入计算机名] # 
If "%pc%"=="" goto A
If "%pc%"=="0" exit
set computername=%pc%
:: PC name
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d "%computername%" /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName" /v ComputerName /t reg_sz /d "%computername%" /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d "%computername%" /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d "%computername%" /f

set/p=  <nulfor /L %%i in (1,1,38) do set /p a= <nul&ping /n 1 127.0.0.1>nul
echo   100%%
:end
exit


 您阅读本篇文章共花了: 

打赏

本文链接:https://kinber.cn/post/2914.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

群贤毕至

访客