Displays SMBIOS information and changes/displays the computer name.
----------------------------------------------------------------------------
Compname v0.4 Copyright Oli Restorick (
[email protected]), 2002.
This is beta software. Use at your own risk.
Uses Mitec SysInfo by Michal Mutl (
www.mitec.d2.cz).
----------------------------------------------------------------------------
COMPNAME [/c name | /d [template] | /s]
/c[hange] Changes the computer name to the one specified.
/d[isplay] Displays the computer name.
/s[mbios] Displays the serial number information from SMBIOS.
name New computer name. Only valid with the /c option.
This may contain macros; see below.
template When used in conjuction with /d, displays the evaluated name.
Templates will normally contain macros; see below.
The following macros are valid in the name or template.
?s = System serial number. ?c = Chassis serial number.
?b = Mainboard serial number.
?a = The first populated number from system, chassis and mainboard numbers.
?u = System UUID ?U = Fake UUID (24 zeros plus MAC).
?G = If System UUID is FFFF... or 0000... or null it uses ?U, otherwise ?u.
?i, ?j, ?k, ?l = 1st, 2nd, 3rd, 4th octets of IP (decimal).
?I, ?J, ?K, ?L = 1st, 2nd, 3rd, 4th octets of IP (hex).
?m = First MAC address. ?e = Existing NetBIOS computer name.
?D = day ?M = month ?Y = year
?1, ?2, ?3, ..., ?0 = 1, 2, 3, ..., 10 random alphanumeric characters.
Examples:
COMPNAME /d Displays the NetBIOS computer name.
COMPNAME /d ?s Displays the system serial number.
COMPNAME /s Displays system summary information.
COMPNAME /c jupiter Changes computer name to "jupiter".
COMPNAME /c acme-?s Changes computer name to "acme-ABCDEF" where
ABCDEF is the system serial number.
Notes:
* You can simply replace a /c switch with a /d switch to check the name.
* If the name (after macro expansion) is longer than 15 characters,
then the NetBIOS name will be truncated, but the DNS name (on Windows
2000 and above) will be the full length. This may break some applications.
* The following characters (and spaces) are invalid an removed automatically:
\ * + = | : ; " ? < > ,
* The _ character gets translated to - to avoid DNS name problems.
This program does not rename the computer's domain account.
You can download the program from
www.willowhayes.co.uk/download/compname.exe.
My current methodology is to let Windows autogenerate a machine name, using
the entries below, and then to call compname.exe from a cmdlines.txt file
placed in the $OEM$ folder.
[UserData]
ComputerName=*
[Identification]
JoinWorkgroup=workgroup
Lines from cmdlines.txt get executed at the end of GUI Mode setup (during
the “registering components†phase).
After a reboot, the new machine name is set. The netdom.exe utility from
the Windows 2000 Resource Kit can be used to join the domain automatically.