原创,在封装的系统,安装过程中提示,设置计算机名称的方法,

封装系统时,常常会考虑到计算机名的设置问题,那么如何在这个过程中自动跳出提示框,通过输入的信息来设置计算机名称呢?
可以将下内容复制后,另存为pcn.bat,为了方便使用可以放在Alluser的启动中,本批处理只运行一次,完成后自动删除.
cls
@echo off
echo Darwin正在为你设置计算机名:
echo 请输的输入一串字符(数字或英文,至少输入1个字符,超出5个,只选择前5个字符)
set /p bianl=计算机名的形式为Nzhe-加上输入的字符串:
set name=Nzhe-%bianl:~,5%

reg add “HKU\S-1-5-21-1844237615-1383384898-1957994488-500\Software\Microsoft\Windows Media\WMSDK\General” /v ComputerName /t reg_sz /d %name% /f

reg add “HKU\S-1-5-21-1844237615-1383384898-1957994488-500\Volatile Environment” /v LOGONSERVER /t reg_sz /d \\%name% /f

reg add “HKCU\Software\Microsoft\Windows Media\WMSDK\General” /v ComputerName /t reg_sz /d %name% /f

reg add “HKCU\Volatile Environment” /v LOGONSERVER /t reg_sz /d \\%name% /f

reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AltDefaultDomainName /t reg_sz /d %name% /f

reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultDomainName /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName” /v ComputerName /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName” /v ComputerName /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\CurrentControlSet\Services\Eventlog” /v ComputerName /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters” /v “NV Hostname” /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters” /v Hostname /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\ControlSet001\Control\ComputerName\ComputerName” /v ComputerName /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName” /v ComputerName /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\ControlSet001\Services\Eventlog” /v ComputerName /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters” /v “NV Hostname” /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters” /v Hostname /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\ControlSet002\Control\ComputerName\ComputerName” /v ComputerName /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\ControlSet002\Services\Eventlog” /v ComputerName /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\ControlSet002\Services\Tcpip\Parameters” /v “NV Hostname” /t reg_sz /d %name% /f

reg add “HKLM\SYSTEM\ControlSet002\Services\Tcpip\Parameters” /v Hostname /t reg_sz /d %name% /f

echo +—————————————————————————+
echo |计算机名设置成功,正在清除临时文件,完成后自动退出,计算机名重启生效……      |
echo +—————————————————————————+
echo wscript.sleep 1000>%tmp%\delay.vbs&&%tmp%\delay.vbs&&del /q %tmp%\delay.vbs

del C:\Docume~1\AllUse~1\「开始~1\程序\启动\pcn.bat

Tags: , , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Leave a Reply

You must be logged in to post a comment.

文字链