HwagPo Posted April 13, 2005 Share Posted April 13, 2005 Hello,Can anyone provide me a script to change the computername?my setup is: after the unattended install, we run a script to localize the PC settings according to the user's location and install the appropriate apps. The first step would be to change the computername to the standard naming convention used depending on the user's location. The unattended setup is set to initially assign a random computername on winnt.sif. After windows installation is complete and during the first logon, I need a script to run and prompt the user for location and based from this change the computername.The reason why we are doing this is so we can distribute unattended cds to remote users and all they have to do is plug the cd in. As soon as setup is finished, the user logs in and prompted for their office location. That's the only prompt we want to ask the user, the rest done automatically.Thanks... Link to comment Share on other sites More sharing options...
totoymola Posted April 13, 2005 Share Posted April 13, 2005 Dude, why use a script when there is a commandline tool available? Try this.http://www.novell.com/coolsolutions/tools/1087.html Link to comment Share on other sites More sharing options...
HwagPo Posted April 13, 2005 Author Share Posted April 13, 2005 hmmm nice. probably what I'm looking for. I'll check it out and see if it works for us.Thanks... Link to comment Share on other sites More sharing options...
totoymola Posted April 13, 2005 Share Posted April 13, 2005 No problem. There are lots of tools similar to this one but this is what I like. Link to comment Share on other sites More sharing options...
The Glimmerman Posted April 13, 2005 Share Posted April 13, 2005 Or you can try this vbscriptDim pc, pcU, value1, value2, title, wsSet ws = WScript.CreateObject("WScript.Shell")value1 = "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"value2 = "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\ParameterS\"title = "Windows XP Professional - Unattended Setup"'--------------------------------Change ComputerName in Registry-------------------------------------pc = InputBox("Enter New Computername.", title)pcU= UCase(pc)If pc <> "" Then ws.RegWrite value1 & "ComputerName", pcU ws.RegWrite value2 & "NV Hostname", pcUEnd If Link to comment Share on other sites More sharing options...
IcemanND Posted April 13, 2005 Share Posted April 13, 2005 I'd change one thing, put a loop around the inputbox so that they have to enter a name before it will continue as changed here.Dim pc, pcU, value1, value2, title, wsSet ws = WScript.CreateObject("WScript.Shell")value1 = "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"value2 = "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\ParameterS\"title = "Windows XP Professional - Unattended Setup"'--------------------------------Change ComputerName in Registry-------------------------------------do pc = InputBox("Enter New Computername.", title) pcU= UCase(pc)loop while pc=""If pc <> "" Then ws.RegWrite value1 & "ComputerName", pcU ws.RegWrite value2 & "NV Hostname", pcUEnd If Link to comment Share on other sites More sharing options...
totoymola Posted April 13, 2005 Share Posted April 13, 2005 You guys are really good on vbscript. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now