1.

Solve : Editing the registry in a script?

Answer»

I need help trying to figure out how to make a script so i can change a computer's name through a script by the input by the USER. I know you have to edit the registry from the command prompt but i am having a hard time figuring out what the syntax needs to be to edit the registry. Thanks for the help.Why do you want to do this?I am working on a TEST bad for my company and i want to change the computer name to match a serial number if a device for possible failure analysis.The Win32_ComputerSystem class has a rename method which might be helpful:

Code: [Select]strComputer="."
newName = InputBox("Enter NEW Name Of Computer", "Rename Computer")
Set objWMIService=GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputers=objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For Each objComputer in colComputers
Err = ObjComputer.Rename(newName)
Next

Quote

Why do you want to do this?

The paranoia level just reached DEFCON 3

Thanks for the help. I will give that a TRY.


Discussion

No Comment Found