如果手动修改计算机名的话,多台电脑可能就感觉有点麻烦了,以下批处理即方便又快捷。童叟无欺,真是好用唉!
@echo off
net.exe session 1>NUL 2>NUL && (
goto gotAdmin
) || (
goto UACPrompt
)
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
:begin
color 3F
chcp 65001
@echo 当前计算机名称 Now Name
hostname
set /p name=请输入新计算机名 New Hostname :
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
@echo 修改完成后的计算机名称
hostname
pause
© 版权声明
分享是一种美德,转载请保留原链接
THE END
暂无评论内容