中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-25 22:00
47,812 topics / 349,910 posts / today 0 new / 48,264 members
DOS批处理 & 脚本技术(批处理室) » How to automatically change the computer name using batch processing?
Printable Version  7,877 / 11
Floor1 zorsite Posted 2006-11-09 00:33
新手上路 Posts 9 Credits 12
If there are many identical computers cloned and installed, and after installation, the computer names are all the same. Once connected to the Internet, the "There are duplicate names on the network" prompt will appear. Then how to use batch processing to change these computer names? The naming rule can adopt "prefix" + "last segment of the IP address". For example, if the prefix is set to H, and the IPs are 192.168.7.3; 192.168.7.147, then the computer names will be H3, H147 respectively.

----------------------------------------------------------------------------------------------------------
附带问 another question:
Still such a batch of computers, and the system properties are all the same information. For example:
Registered to:
USER
DELL
There will be a problem. For example, when I install OFFICE, Kingsoft Iceberg, the user name and unit will be automatically filled with these information. Is there a way to use batch processing to automatically change the registration information?
Floor2 holee Posted 2006-11-11 12:08
初级用户 Posts 27 Credits 53
Passing by, paying attention to this issue.
Floor3 zerocq Posted 2006-11-11 13:15
中级用户 Posts 196 Credits 458
All this information is about modifying the registry.

The computer name can be modified by calling the Control Panel or by calling the Registry Editor. For example, to change the computer name from 'MMX233' to 'P233', you can follow these steps: Open HKEY_LOCAL_MACHINE\System\CurrenControlSet\Control\ComputerName\ComputerName, change the value of the key named 'ComputerName' from the original 'MMX233' to 'P233', and it will take effect after logging off the user or restarting Windows.

Find some materials for personalizing the computer by modifying the registry to have a look.

Find the modification points, and you can use batch processing/vbs to make the change, which is very easy :D

[ Last edited by zerocq on 2006-11-11 at 01:17 PM ]
Floor4 ccwan Posted 2006-11-11 21:33
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
There are quite a few such problems in the forum. Just search it. Also, there is in Wuyou Boot Forum.
Floor5 hxuan999 Posted 2006-11-13 07:43
中级用户 Posts 161 Credits 337
I will also pay attention.
Floor6 honhaizh Posted 2006-11-16 19:52
初级用户 Posts 18 Credits 35
I found two tools that are both in the Ghost 8.3 suite:
(1) ghstwalk.exe: Rename Windows under pure DOS, can specify a name or assign randomly
(2) GhRegEdt.exe: Modify Windows registry under pure DOS, change the following key values:
HKLM\SYSTEM\ControlSet001\Control\ComputerName\ComputerName
ComputerName
HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters
NV Hostname
Floor7 tyh Posted 2007-04-22 05:58
初级用户 Posts 43 Credits 80
Heheh. I know this. To change the computer name, use wmic computersystem where "name='%nowname%'" call rename %name%

'%nowname%' is the current name, %name% is the name you want to change to.

Similarly: To change the workgroup
wmic computersystem where "domain='%work%'" call joindomainorworkgroup "","","%group%",1

[ Last edited by tyh on 2007-4-21 at 05:05 PM ]
Floor8 lmj243 Posted 2007-04-23 03:37
新手上路 Posts 6 Credits 6
Floor9 wgx1688 Posted 2007-04-24 04:15
初级用户 Posts 34 Credits 60
Floor10 bjsh Posted 2007-04-24 05:40
银牌会员 Posts 621 Credits 2,000
RE:LS

Sure!


Try this; automatically change your computer name to a name combined with H and the last digit of the IP.

Tested on xpsp2


  1. @echo off
  2. for /f "tokens=17 delims=:." %%a in ('ipconfig ^|findstr "IP Address" ^| more +1') do set "NAME=H%%a"
  3. echo %NAME%
  4. wmic computersystem where "PrimaryOwnerName='%username%'" call rename %NAME%
Posted by BJSH on: 2007-04-23 16:25
Floor11 zk0888 Posted 2008-03-13 11:38
新手上路 Posts 3 Credits 6
Floor12 tian88yuan Posted 2010-05-29 11:06
新手上路 Posts 6 Credits 9
A batch file for modifying the computer name found online
-----------------------------
@echo off
title Modify Computer Name
set /p cname=Please enter the computer name:

echo REGEDIT4 >name.reg

echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName] >> name.reg

echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName] >> name.reg
echo "ComputerName"="%cname%" >> name.reg

echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName] >> name.reg
echo "ComputerName"="%cname%" >> name.reg

echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\ComputerName\ComputerName] >> name.reg
echo "ComputerName"="%cname%" >> name.reg

echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] >> name.reg
echo "NV Hostname"="%cname%" >> name.reg
echo "Hostname"="%cname%" >> name.reg

echo [HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\ShellNoRoam] >> name.reg
echo @="%cname%" >> name.reg

echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName] >> name.reg
echo "ComputerName"="%cname%" >> name.reg

echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters] >> name.reg
echo "NV Hostname"="%cname%" >> name.reg
echo "Hostname"="%cname%" >> name.reg

echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >> name.reg
echo "DefaultDomainName"="%cname%" >> name.reg
echo "AltDefaultDomainName"="%cname%" >> name.reg
name.reg
pause
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023