Name = "name"
Password = "password"
Username = "username"
Set objWMIService = GetObject("Winmgmts:root\cimv2")
' Call always gets only one Win32_ComputerSystem object.
For Each objComputer in
objWMIService.InstancesOf("Win32_ComputerSystem")
Return = objComputer.rename(Name,Password,User)
If Return <> 0 Then
WScript.Echo "Rename failed. Error = " & Err.Number
Else
WScript.Echo "Rename succeeded. Reboot for new name to go into
effect"
End If
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.