把以下文章保存批处理文件,如保存为a.bat ,运行,修改你需要改的计算机名即可!
' y- k3 |% E. O. g) \8 L2 _以下是代码段:
# `" x0 @- S9 I9 ?( S3 J6 j' Q3 j' `2 P$ g3 U! u
@echo off
: m5 ?- [6 {7 `+ B# `9 B& l* Rset /p name=请输您的计算机名:) \$ Y0 F6 u7 L( } y
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul3 ^9 t7 G$ D% x& r& `
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul
/ Y: v" U4 e) A p: d3 areg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul
; o9 k8 g1 R6 K% e, \( L& ]' D) w. g. t+ H
echo.. Q/ a6 T% }; @: l2 |
echo 修改计算机名完毕: B, b1 C% M& X, j" d- G
echo.% w1 U# _* P: W) m
set /p work1=请输入您的工作组名:9 e' Y4 \7 v2 G- z
wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="%work1%"
/ p* e) R1 {0 o0 |1 r9 jecho 修改工作组完毕
, X; t+ n. x1 l& ]0 e+ q* P" Jpause>nul
: [! t" G6 g2 O* n( [4 C: Decho. |