How to change hostname in windows xp by command line

Copy into notepad and save with .vbs extension, run in command prompt as admin.

strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″)

Name = "MY_PC_NAME"
Set colComputers = objWMIService.ExecQuery (“Select * from Win32_ComputerSystem”)

For Each objComputer in colComputers
err = objComputer.Rename(name)
if err <> 0 then
wscript.echo “There was an error renaming the machine. Please restart, and try again.”
else
wscript.echo “Machine successfully renamed: ” & Name
end if
Next