|
本帖最后由 4238500 于 2024-1-11 11:27 编辑
抄了论坛几位大佬的批处理,弄了个改计算机名的批处理,按当前时间改计算机名,顺便改OEM信息。
@echo off
color 2f
pushd %~dp0
Set h=%time:~0,2%
set h=%h: =0%
set pcname=PC-%date:~0,4%%date:~5,2%%date:~8,2%%h%%time:~3,2%
echo Windows Registry Editor Version 5.00>ComputerName.reg
echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam]>>ComputerName.reg
echo @="%pcname%">>ComputerName.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName]>>ComputerName.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName]>>ComputerName.reg
echo "ComputerName"="%pcname%">>ComputerName.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName]>>ComputerName.reg
echo "ComputerName"="%pcname%">>c:\TempInfo.reg>>ComputerName.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog]>>ComputerName.reg
echo "ComputerName"="%pcname%">>ComputerName.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName]>>ComputerName.reg
echo "ComputerName"="%pcname%">>ComputerName.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]>>ComputerName.reg
echo "NV Hostname"="%pcname%">>ComputerName.reg
echo "Hostname"="%pcname%">>ComputerName.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation]>>ComputerName.reg
echo "Manufacturer"="%pcname%">>ComputerName.reg
echo "Model"="%pcname%">>ComputerName.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]>>ComputerName.reg
echo "RegisteredOrganization"="%pcname%">>ComputerName.reg
echo [HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\ShellNoRoam]>>ComputerName.reg
echo @="%pcname%">>ComputerName.reg
regedit /s ComputerName.reg
del /q ComputerName.reg |
|