Skip to content

Instantly share code, notes, and snippets.

@benzBrake
Created January 18, 2021 00:16
Show Gist options
  • Save benzBrake/048a46e5bb120f8ba4b362e0398e4214 to your computer and use it in GitHub Desktop.
Save benzBrake/048a46e5bb120f8ba4b362e0398e4214 to your computer and use it in GitHub Desktop.
设置计算机名
@echo off
set /p name=请输您的计算机名:
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\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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment