[Shell] 纯文本查看 复制代码拷贝一下脚本到.bat文件,双击运行即可,有交互式提示输入新的计算机名
@ ECHO OFF
color 0A
ECHO ----------------------------------------------------------------------------
ECHO.
ECHO 版权所有 copyright of @@@@@@@@@
ECHO.
ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO.
:name
set /p cname=请输入计算机名:
echo REGEDIT4 >c:\windows\reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName] >> c:\windows\reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName] >> c:\windows\reg.reg
echo "ComputerName"="%cname%" >> c:\windows\reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName] >> c:\windows\reg.reg
echo "ComputerName"="%cname%" >> c:\windows\reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\ComputerName\ComputerName] >> c:\windows\reg.reg
echo "ComputerName"="%cname%" >> c:\windows\reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] >> c:\windows\reg.reg
echo "NV Hostname"="%cname%" >> c:\windows\reg.reg
echo "Hostname"="%cname%" >> c:\windows\reg.reg
echo [HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\ShellNoRoam] >> c:\windows\reg.reg
echo @="%cname%" >> c:\windows\reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName] >> c:\windows\reg.reg
echo "ComputerName"="%cname%" >> c:\windows\reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters] >> c:\windows\reg.reg
echo "NV Hostname"="%cname%" >> c:\windows\reg.reg
echo "Hostname"="%cname%" >> c:\windows\reg.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >> c:\windows\reg.reg
echo "DefaultDomainName"="%cname%" >> c:\windows\reg.reg
echo "AltDefaultDomainName"="%cname%" >> c:\windows\reg.reg
regedit /s c:\windows\reg.reg
cmd
---------------------
原文:https://blog.csdn.net/jiangqin115/article/details/50813534