计算机名,window批处理修改计算机名

二、无需重启

@echo off
echo 骏龙包装Computer名称、计算机描述、工作组修改批管理程序
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_MACHINESystemCurrentControlSetControlComputerNameActiveComputerName”
/v ComputerName /t reg_sz /d %name% /f
reg add
“HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters”
/v “NV Hostname” /t reg_sz /d %name% /f
reg add
“HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters”
/v Hostname /t reg_sz /d %name% /f
SET work=骏龙
wmic computersystem where Name=”%NAME%” call JoinDomainOrWorkgroup
Name=”%work%”
set /p describe=请输入您的Computer描述(公司规定必须是使用者姓名):
reg add
“HKEY_LOCAL_MACHINESystemCurrentControlSetServiceslanmanserverParameters”
/v srvcomment /t reg_sz /d %describe% /f

@echo off
set /p pcnanme=请输入Computer的名字:
reg add
HKEY_LOCAL_MACHINESYSTEMControlSet001ControlComputerNameComputerName
/v ComputerName
/t REG_SZ /d
%pcnanme% /f
eixt

wmic computersystem where Name=”%COMPUTERNAME%” call
JoinDomainOrWorkgroup Name=”%WORKGROUP%”
现今大家把它写成三个批管理,来贯彻没有须求重启修改Computer名和职业组:

 

职业组的修改能够经过三个wmic命令来兑现目标。

@echo off
set /p name=输入新的微管理器名称
wmic computersystem where “PrimaryOwnerName=’%username%'” call rename
%NAME%&exit
行使wmic改名不用重启

net config server /SRVCOMMENT:”%describe%”
pause

 

复制代码 代码如下:

@echo off
echo AppLife.Net
set /p name=请输您的Computer名:
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.
echo AppLife.Net
set /p work1=请输入您的职业组名:
wmic computersystem where Name=”%COMPUTERNAME%” call
JoinDomainOrWorkgroup Name=”%work1%”
echo 修改职业组落成
pause>nul
echo.

@echo off
echo AppLife.Net
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 修改Computer名完成
echo.
echo AppLife.Net
set /p work1=请输入您的行事组名:
wmic computersystem where Name=”%COMPUTERNAME%” call
JoinDomainOrWorkgroup Name=”%work1%”
echo 修改专门的职业组实现
pause>nul
echo.

Leave a Comment.