AcidHeat79 Posted January 20, 2011 Posted January 20, 2011 (edited) I've been looking around for a while, to get a smooth way to change computer name remotely. I know that there are utils that does that, but I'm really looking for a simple command line with parameters, if exists? Using registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName) works after reboot, with some side effects (If you check in control Panel->System it will keep show you old name, although system uses new name). Any explanations how to fix that? RegWrite ( "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", "Cockstand101XP") What do i add after this? How to command a reboot or will this work in the first place when we just change the registry. Should i also alter the active computer name too by adding another line in AutoIT script? RegWrite ( "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName", "ComputerName", "REG_SZ", "Cockstand101XP") Coz actually i want it to prompt as a pop-up box asking me to enter the value as this is for many many pc. At least users can enter what i instruct them to enter. Edited January 20, 2011 by AcidHeat79
gerwim Posted January 20, 2011 Posted January 20, 2011 Why not search the complete registry for the old computer name and change all those values?
willichan Posted January 20, 2011 Posted January 20, 2011 Here is what I use on XP boxes Func _RenameComputer($mname) RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName", "ComputerName", "REG_SZ", $mname) RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $mname) RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", $mname) RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $mname) ;next line is not really needed, but makes things easier during initial config. It just sets the default domain to the new local machine name. RegWrite("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", $mname) EndFunc ;==>_RenameComputer You will still have to reboot before it will work. If you are running additional network protocols (Novell, etc...) there may be other locations that need patching. This should work for a standard TCP/IP network. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash
AcidHeat79 Posted January 20, 2011 Author Posted January 20, 2011 Why not search the complete registry for the old computer name and change all those values?ok lets say i have a few registry key that i need to change...How can it be customise as 5 users will have to change to a different name when running the script...I thought of this script to run, a pop-up prompting what to enter as computername...Then all registry being copied to what is being entered, then reboot iniated...with a message box prompting to save all work, and "REBOOT" with and OK button flag 0.But i dont know how to write it.
AcidHeat79 Posted January 25, 2011 Author Posted January 25, 2011 ok lets say i have a few registry key that i need to change...How can it be customise as 5 users will have to change to a different name when running the script...I thought of this script to run, a pop-up prompting what to enter as computername...Then all registry being copied to what is being entered, then reboot iniated...with a message box prompting to save all work, and "REBOOT" with and OK button flag 0.But i dont know how to write it.anyone?
wakillon Posted January 25, 2011 Posted January 25, 2011 There is also _SetComputerName function of Jscript ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
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