Brett
Fri Feb 06 00:50:38 CST 2004
Try this. It will ask you to change the name then type in the new name of the pc. You will need to reboot for the changes to take place
Cheers
Brett
PcName = InputBox("Please type in the PC Name (Username)")
Set objWMIService = GetObject("Winmgmts:root\cimv2")
For Each objComputer in objWMIService.InstancesOf("Win32_ComputerSystem")
Return = objComputer.rename(Ucase(PcName))
If Return <> 0 Then
WScript.Echo "Rename failed. Error = " & Err.Number
Else
WScript.Echo "I Need to restart"
End If
Next
**********************************************************************
Sent via Fuzzy Software @
http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...