批处理文件,添加到启动项后可以在登陆系统后修改计算机名为当前时间并删除本批处理防止再次执行,建议修改后重启,否则会出现很多错误
@echo off
set name=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v "ComputerName" /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName" /v "ComputerName" /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "Hostname" /t reg_sz /d %name% /f
del %0
转载于:https://blog.51cto.com/gregdefanhua/1438175