把以下文章保存批处理文件,如保存为a.bat ,运行,修改你需要改的计算机名即可!& f/ ~# t2 y+ h/ i: c
以下是代码段:, X. m# h# D7 A( N: y
4 V- V$ C" J1 z' `8 D& O, N
@echo off
2 O! S* U' _" c& o9 M cset /p name=请输您的计算机名:. Q2 ^2 K8 G4 k6 b+ p7 `) D
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul6 v: z, L' r V$ K) b9 y
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul, w) w+ E" W i0 t6 \- v
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul, x4 Q: x' J/ e0 y
# Y9 {9 w' O. n8 M
echo.
A7 ^& w" ~" e# ~1 i becho 修改计算机名完毕
' k" w3 M, R2 w$ n+ hecho.
3 W) z0 ^5 S6 g8 Aset /p work1=请输入您的工作组名:
9 y5 g1 N; E8 f4 r& `wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="%work1%"
3 F" d$ |6 }2 S; f; B! ~* Aecho 修改工作组完毕
3 q4 U3 @( P. gpause>nul8 ^8 A# Q/ c2 Z2 ?( u) S
echo. |