把以下文章保存批处理文件,如保存为a.bat ,运行,修改你需要改的计算机名即可!
! x( j7 L4 h" J: X0 m, M以下是代码段:# {, e) Z& J# M& B5 ]8 W
# p3 e) X1 t, ~. v* O6 I) U1 x6 }
@echo off' ?, y% @6 E1 i) h% U- W8 C
set /p name=请输您的计算机名:' o# d# z6 Z& Z: r) G: L$ s
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul
- R j7 n" t& U6 ? f# i1 Rreg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul
! ~1 m. @" K" l0 ereg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul
2 e* ~3 I# i. }2 {. A2 L: ~0 s4 _4 q5 r. E- G
echo.2 s$ D) L# b$ m( E5 L
echo 修改计算机名完毕3 [, S- }+ L2 W( v3 ^0 Y6 r
echo.
7 h, r; Z- R- K8 f' }! f. E! Eset /p work1=请输入您的工作组名:- L* N8 V& u% Q, g$ K4 t; C1 q' H. z
wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="%work1%"
4 p6 l( D) z! m* J0 l& lecho 修改工作组完毕
. T- Z2 [" G& Z6 ^: v6 z8 Epause>nul% S. j; |. y6 v8 ]' e" p3 k9 F- @
echo. |