将以下代码另存为bat或者cmd文件即可;
@echo off title 更改计算机名不重启 set /p name=请输您的计算机名: reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetControlComputerNameActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul echo. echo 修改计算机名完毕