把以下文章保存批处理文件,如保存为a.bat ,运行,修改你需要改的计算机名即可!
# L' @5 W$ `( v7 }以下是代码段:( U: Y3 R* F/ q1 f: D- S; {
) p' ?- e$ E. m2 L$ J1 \
@echo off
# S6 x J% w2 ?8 {" ?/ y/ dset /p name=请输您的计算机名:" L6 `# X8 P. X5 @
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul# j5 \! W0 q1 f; N" C
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul6 i5 _- p6 m8 h }% g$ D
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul5 a$ I( p4 [$ E M! W3 W, k
: I6 U% `* C% U N+ x6 T8 Recho.
5 r- {8 q9 E2 t6 g( X% g& {echo 修改计算机名完毕: @* \( p7 n! p* d
echo.2 y" `# ?: y3 T
set /p work1=请输入您的工作组名:
' ^/ I4 o, m: T" L. o9 o6 j2 _wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="%work1%", T; t6 g' o8 O. B+ D; q
echo 修改工作组完毕7 U* s$ m/ r- [/ X1 ?
pause>nul
6 ^4 U( w" z4 F8 s! fecho. |