把以下文章保存批处理文件,如保存为a.bat ,运行,修改你需要改的计算机名即可! f* q( B$ g) i( G
以下是代码段:
9 c' @( H3 _( q; }2 c4 j6 H+ R7 K* o c
@echo off, }! ^4 T4 d& o& _( X7 r* N
set /p name=请输您的计算机名:( D8 D: w0 Y( M; A! x' ^6 Y" L$ T
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul' B8 ]3 P& K% O" ?# K6 x
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul/ W9 u( T; L8 R) o" m
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul" f. ~, ]/ @ {0 m. _
- J( K+ g$ w, F- Decho.
& w, t" _5 b. j; F/ becho 修改计算机名完毕
" g' K9 v- c+ g% ]$ W+ L' ? xecho.4 m/ j! ]& d( ~
set /p work1=请输入您的工作组名:
( I4 T7 E; B( Y! owmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="%work1%"
& X" K2 s1 J( r: H7 Yecho 修改工作组完毕- {( A- t# C0 k$ k6 x% S5 F3 B6 u _
pause>nul, a3 |% [; ]4 E8 J, }% h3 x
echo. |