菜单

window批处理修改总结机名

2019年3月30日 - LINUX

不必要重启

 

@echo off
manbetx网页手机登录版,echo AppLife.Net
set /p name=请输您的总结机名:
reg add
“HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName”
/v ComputerName /t reg_sz /d %name% /f >nul 2>nul
reg add
“HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters”
/v “NV Hostname” /t reg_sz /d %name% /f >nul 2>nul
reg add
“HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters”
/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     修改计算机器名... 
set pcname=WinXP-%random:~-3% 
echo Windows Registry Editor Version 5.00>ComputerName.reg 
echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam]>>ComputerName.reg 
echo @="%pcname%">>ComputerName.reg 
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName]>>ComputerName.reg 
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName]>>ComputerName.reg 
echo "ComputerName"="%pcname%">>ComputerName.reg 
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName]>>ComputerName.reg 
echo "ComputerName"="%pcname%">>c:\TempInfo.reg>>ComputerName.reg 
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog]>>ComputerName.reg 
echo "ComputerName"="%pcname%">>ComputerName.reg 
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName]>>ComputerName.reg 
echo "ComputerName"="%pcname%">>ComputerName.reg 
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]>>ComputerName.reg 
echo "NV Hostname"="%pcname%">>ComputerName.reg 
echo "Hostname"="%pcname%">>ComputerName.reg 
echo [HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\ShellNoRoam]>>ComputerName.reg 
echo @="%pcname%">>ComputerName.reg 
regedit /s ComputerName.reg 
del /q ComputerName.reg 
echo     修改计算机器名称完成... 
del %0 

壹 、供给重启

 

要求重启电脑才能见效

 

@echo off
set /p name=输入新的微型总结机名称
wmic computersystem where “PrimaryOwnerName=’%username%'” call rename
%NAME%&exit
动用wmic改名不用重启

@echo off
set /p pcnanme=请输入总结机的名字:
reg add
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName
/v ComputerName
/t REG_SZ /d
%pcnanme% /f
eixt

 

由此修改注册表修改主机名和工作组

 

贰 、不需求重启

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图