原文出处
http://www.cnblogs.com/justinzhang/archive/2011/09/25/2189866.html
感谢作者:justinzhang
@ 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