|
- @echo off&setlocal enabledelayedexpansion
- set "str=abcdefghijklmnopqrstuvwxyz"
- set/a aa=%random%%%26
- set/a bb=%random%%%26
- set/a cc=%random%%%26
- set/a dd=%random%%%26
- set pcname=Win-20%date:~2,2%%date:~5,2%%date:~8,2%!str:~%aa%,1!!str:~%bb%,1!!str:~%cc%,1!!str:~%dd%,1!
- echo %pcname%
- reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %pcname% /f >nul 2>nul
- reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %pcname% /f >nul 2>nul
- reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %pcname% /f >nul 2>nul
- pause
复制代码 |
|