把以下文章保存批处理文件,如保存为a.bat ,运行,修改你需要改的计算机名即可!. D V" W" w2 ]: i! e2 |/ x q' s6 V
以下是代码段:/ v1 ^& M& M( F( @+ J' K
7 a% Y6 {# X* D, ?' x# F
@echo off
% L6 W3 l5 V; E L1 Jset /p name=请输您的计算机名:
7 e: ]. @! h" }+ e$ Breg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul5 I2 I, W5 c2 H7 V# j: r
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul& u# i. e+ |. E" L) O
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul9 W; N; {) y$ W3 j
U+ k" v D+ I
echo.
! g1 M" E H9 P* Becho 修改计算机名完毕& Z+ j& t! R; q9 u: {3 [
echo.
# ]5 `0 |( s- W* s( C/ {8 V1 Tset /p work1=请输入您的工作组名:8 j% _3 I! p& {0 J% c
wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="%work1%"
7 V$ i, G/ X1 W' O/ [echo 修改工作组完毕; }5 t. t+ j& v y' k8 z
pause>nul: t; `- b& Z/ v4 k
echo. |