When managing a large clients computers sometimes the best name convention for every client computer is a unique number so it is easy to locate and manage. One unique number available in most, if not every computer, is its serial number, with DELL computers it is known as Service Tag.
When needed it is easy to change one single computer name, but when doing a big deployment, like new computers, new operating system revision, and more it can be complicated.
With this script, in that case 2 files, the computer will be renamed with its own serial number (Service Tag) on next reboot, the purpose of the 2 files are:
* RunOnce.reg: Registry file to add the path to the script (note the double bar for the path to work), it uses the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce. When the script is run the entry on the regsitry gets deleted.
* ChangeName.vbs: The script itself, needs to be adjusted with a valid local administrator account, with username and password on line 22 and 23. In case of storing the file in a different path than C:\Windows the script have to be adjusted on line 44.
After running the script the file gets deleted, so not to worry, so much, with security regarding local administrator username and password in plain text.