@echo off
echo 骏龙包装计算机名称、计算机描述、工作组修改批处理程序
Echo
pause
cls
:set/p id=请输入本机网段号:
:set/p ip=请输入本机IP地址:
:netsh interface ip set address name="本地连接" source=static addr=192.168.%id%.%ip% mask=255.255.255.0
set /p name=请输您的主机出厂S/N编号:
reg add "HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/ComputerName/ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/Tcpip/Parameters" /v "NV Hostname" /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/Tcpip/Parameters" /v Hostname /t reg_sz /d %name% /f
SET work=骏龙
wmic computersystem where Name="%NAME%" call JoinDomainOrWorkgroup Name="%work%"
set /p describe=请输入您的计算机描述(公司规定必须是使用者姓名):
reg add "HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/lanmanserver/Parameters" /v srvcomment /t reg_sz /d %describe% /f
net config server /SRVCOMMENT:"%describe%"
pause
wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="%WORKGROUP%"
现在我们把它写成一个批处理,来实现无需重启修改计算机名和工作组: