>HOWEVER THIS DOESN'T WORK WHAT HAVE I MISSED ?
You should specify Username and Password (and it must be from some administrator) for they are not optional, if you print the error (? loCS.Rename(lcNewName)) You'll probably see the error is 2221, which is "User name could not be found"
A shorter way of doing it is:
loWMIService = GETOBJECT("winmgmts:")
loCS = loWMIService.Get("Win32_ComputerSystem.Name='" + Getenv("COMPUTERNAME") + "'")
if loCS.Rename(lcNewName, lcAdminUser, lcAdminPassword)
? 'You need to reboot'
endif
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges