- Scripting the Computer Name
- Generating a Computer Name with Script
- Listing of COMPNAME.VBS
Generating a Computer Name with Script
In many of the deployments I've worked on, companies use the BIOS service tag or asset tag as part of the naming algorithm. Unfortunately, the out-of-the-box naming mechanisms didn't provide for this type of naming standard. To work around the limited options, I developed a script that uses the Visual Basic Scripting Language and Windows Management Infrastructure (WMI) to query against SerialNumber from Win32_Systemenclosure. For systems using a BIOS that adheres to the SMBIOS standard, this script will pull the system service tag.
Save this script as COMPNAME.VBS. Run the script using CSCRIPT.EXE from the command line (for example, CSCRIPT COMPNAME.VBS). Running this script will create a SYSNAME.INF file in the directory from which the script executes.