计算机名,修改注册表键值

一 、必要重启

@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 pcnanme=请输入电脑的名字:
reg add
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName
/v ComputerName
/t REG_SZ /d
%pcnanme% /f
eixt

 

@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