把以下文章保存批处理文件,如保存为a.bat ,运行,修改你需要改的计算机名即可!
. M6 k: ]1 U( \" v7 s以下是代码段:
% {% s2 ~' t i1 D6 U
+ b b9 B. p5 S6 ]/ H@echo off8 |0 o! P* K K S2 j9 K
set /p name=请输您的计算机名:1 m( T" v$ i" G9 s
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul' X! G; \% a# a: B
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul4 F V% i+ q6 [" Z' Q. k
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul f! C, I' |: t' p
4 w9 N9 j' O- _# d1 T+ i* ]echo.
+ p C9 h% |( ^echo 修改计算机名完毕0 ~) V3 [0 z2 K$ s6 |, x
echo.
3 C0 N3 g+ a9 |' sset /p work1=请输入您的工作组名:
8 n& z3 s8 z) Q$ b! A& `/ N! a2 Cwmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="%work1%"
0 `2 C8 v" U' }% zecho 修改工作组完毕7 X Z1 P) E1 p* N9 p
pause>nul
( ], i# R% R2 o1 N+ U% G; recho. |