window 加域 脚本
加入域:
@echo off
netdom join %computername% /domain:domain /UserD:user /PasswordD:password /REBoot:5
退出域:
@echo off
netdom remove %computername% /domain:domain /UserD:user /PasswordD:password /REBoot:5
使用批处理进行工作组修改,主要是使用wmic命令:
@echo off
set /p name=请输您的计算机名:
reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetControlComputerNameActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul
reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul
reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul
echo.
echo 修改计算机名完毕
echo.
set /p work1=请输入您的工作组名:
wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="%work1%"
echo 修改工作组完毕
pause>nul
echo.