PowerShell can also rename computers. The next example will read the serial number from the system enclosure class and rename the computer accordingly (provided you have local admin privileges):
$serial = Get-WmiObject Win32_SystemEnclosure | Select-Object -expand serialnumber if ($serial -ne 'None') { (Get-WmiObject Win32_ComputerSystem).rename("DESKTOP_$serial") } else { Write-Warning 'Computer has no serial number' }