Ibrahim Posted September 27, 2007 Posted September 27, 2007 in windows xp i want to change my computer name without having to restart my computer would somebody please help oding that in autoit as i did a program to change mac address and ip address but computer name requirs a reboot to be changed [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker
SkinnyWhiteGuy Posted September 27, 2007 Posted September 27, 2007 expandcollapse popup;==================================================================================== ; Fix Computer Name & Workgroup Name Script ; by: tHe SkInNy WhItE GuY ; 03-06-2007 ;==================================================================================== ; Initialize Settings #include <GUIConstants.au3> #NoTrayIcon ; Initialize Variables Needed Dim $CompName, $Workgroup, $dir_create ; Build Forms to ask User for New Name and Workgroup Selection Box Opt("GUIOnEventMode", 1) $mainwindow = GUICreate("Name Changer", 200, 120) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Enter the name and workgroup to set on this computer", 10, 10, 180, 30) GUICtrlCreateLabel("Name", 10, 40, 70, 20) GUICtrlCreateLabel("Workgroup", 10, 60, 70, 20) $inp_name = GUICtrlCreateInput("", 80, 40, 100, 20) $inp_group = GUICtrlCreateInput("", 80, 60, 100, 20) $set = GUICtrlCreateButton("Set", 70, 90, 60) GUICtrlSetOnEvent($set, "Set_Names") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func Set_Names() ; Name & Workgroup Name $CompName = GUICtrlRead($inp_name, 1) $Workgroup = GUICtrlRead($inp_group, 1) GUICtrlSetState($inp_name, $GUI_DISABLE) GUICtrlSetState($inp_group, $GUI_DISABLE) GUICtrlSetData($set, "Updating...") GUICtrlSetState($set, $GUI_DISABLE) ; Install needed files onto the computer FileInstall ("NetDom.exe", @TempDir & "NetDom.exe", 1) ; Make some registry changes to also change the name now RegDelete ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname") RegDelete ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname") RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Computername\Computername", "Computername", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername", "Computername", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AltDefaultDomainName", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", $CompName) RegWrite ("HKEY_USERS\.Default\Software\Microsoft\Windows Media\WMSDK\General", "Computername", "REG_SZ", $CompName) ; Change Workgroup with Netdom.exe RunWait (@TempDir & "Netdom.exe Member \\" & $CompName & " /JOINWorkgroup " & $Workgroup, "", @SW_HIDE) ; Remove needed files FileDelete (@TempDir & "NetDom.exe") MsgBox(0, "Done", "Computer was renamed to """ & $CompName & """ and workgroup was set to """ & $Workgroup & """.") GUICtrlSetState($inp_name, $GUI_ENABLE) GUICtrlSetState($inp_group, $GUI_ENABLE) GUICtrlSetData($set, "Set") GUICtrlSetState($set, $GUI_ENABLE) EndFunc ;==>Set_Names Func CLOSEClicked() Exit EndFunc ;==>CLOSEClicked That code requires Netdom.exe to exist in the same directory as the script when you compile it/run it, search on google, it's free, and it's only needed for changing the Workgroup name as well, so if you don't need that, just edit out the lines that use it, and have fun.
Ibrahim Posted September 27, 2007 Author Posted September 27, 2007 this thing requires a reboot which i don't wanna do-i need to change it without a rebooooot [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker
SkinnyWhiteGuy Posted September 28, 2007 Posted September 28, 2007 Uh, I use it at work, and my method above correctly changes the PC name without needing a reboot. Run it, then check your System Properties for the change.
Ibrahim Posted September 28, 2007 Author Posted September 28, 2007 yup i know but it takes long time to be effective in the network i need to make it immediate [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker
MadBoy Posted September 28, 2007 Posted September 28, 2007 (edited) yup i know but it takes long time to be effective in the network i need to make it immediateI"m just guessing here but maybe you could use in the end of the script proposed about --> ipconfig /release, ipconfig /renew so the network stuff would be resent? Edited September 28, 2007 by MadBoy My little company: Evotec (PL version: Evotec)
Ibrahim Posted September 28, 2007 Author Posted September 28, 2007 it's not about the ip configuration it's about the server service and LmLookup LmHosts stuff which takes long time to refresh [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker
lordofthestrings Posted September 28, 2007 Posted September 28, 2007 basically I don't think it is possible to rename A PC without reboot.. I would like to see someone prove me wrong but I'm quite confident on this one.. the computername is easy to change (plenty of different approaches to do it) but TCP/IP will be the root of the problem.. (try pinging the computers' new hostname before reboot, or the old hostname for that matter)
Ibrahim Posted September 28, 2007 Author Posted September 28, 2007 well that man script does it and without a reboot the problem is the long time the server service takes to apply changes,except for that this script does it [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker
Richard Robertson Posted September 28, 2007 Posted September 28, 2007 That's why if you release your IP address, the new address will be associated with the new hostname. Did you even try it?
Ibrahim Posted September 28, 2007 Author Posted September 28, 2007 (edited) C:\Documents and Settings\Family>ipconfig /release Windows IP Configuration The operation failed as no adapter is in the state permissible for this operation. C:\Documents and Settings\Family>ipconfig /renew Windows IP Configuration The operation failed as no adapter is in the state permissible for this operation. first off all i use static ip and second of i guess it's never related and last but not least i really thank you guys for the effort Edited September 28, 2007 by Ibrahim [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker
Developers Jos Posted September 28, 2007 Developers Posted September 28, 2007 What is the environment you are doing this in ? AD/DHCP/Dynamic DNS or something else ? How do you determine that the hostname didn't change ? You are aware the a PC doesn't do a DNS lookup everytime a hostname/IPaddress is provide but has its own cache in which the DNS entries are cached for a period as define by TTL ? To flush that use: IPconfig /flushdns SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past.Â
AdmiralAlkex Posted September 28, 2007 Posted September 28, 2007 (edited) well that man script does it and without a reboot the problem is the long time the server service takes to apply changes,except for that this script does itMy guess would be to restart the server service, have you tried that??(restarting fixes a lot in windows... ) Edited September 28, 2007 by TzarAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Ibrahim Posted September 29, 2007 Author Posted September 29, 2007 well as to know that my computer name has changed "nbtstat -R" "nbtstat -A 10.0.0.33" restarting the server service is the first thing i did,but i can try something else restarting the network connection never done that.realy thank you guys,gonna give it a try [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker
Ibrahim Posted September 30, 2007 Author Posted September 30, 2007 Guys, i did it thanks alot for your help and thank you skinnywhite guy for ur reply couldn't do it without your help and never know the netdom tool ,and guys all you have to do is to repair your network connection as ipconfig /release,renew isn't working with static ip addresses and repairing will flush all changable data, Thanks again [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker
Lakers24 Posted March 16, 2010 Posted March 16, 2010 expandcollapse popup;==================================================================================== ; Fix Computer Name & Workgroup Name Script ; by: tHe SkInNy WhItE GuY ; 03-06-2007 ;==================================================================================== ; Initialize Settings #include <GUIConstants.au3> #NoTrayIcon ; Initialize Variables Needed Dim $CompName, $Workgroup, $dir_create ; Build Forms to ask User for New Name and Workgroup Selection Box Opt("GUIOnEventMode", 1) $mainwindow = GUICreate("Name Changer", 200, 120) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Enter the name and workgroup to set on this computer", 10, 10, 180, 30) GUICtrlCreateLabel("Name", 10, 40, 70, 20) GUICtrlCreateLabel("Workgroup", 10, 60, 70, 20) $inp_name = GUICtrlCreateInput("", 80, 40, 100, 20) $inp_group = GUICtrlCreateInput("", 80, 60, 100, 20) $set = GUICtrlCreateButton("Set", 70, 90, 60) GUICtrlSetOnEvent($set, "Set_Names") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func Set_Names() ; Name & Workgroup Name $CompName = GUICtrlRead($inp_name, 1) $Workgroup = GUICtrlRead($inp_group, 1) GUICtrlSetState($inp_name, $GUI_DISABLE) GUICtrlSetState($inp_group, $GUI_DISABLE) GUICtrlSetData($set, "Updating...") GUICtrlSetState($set, $GUI_DISABLE) ; Install needed files onto the computer FileInstall ("NetDom.exe", @TempDir & "NetDom.exe", 1) ; Make some registry changes to also change the name now RegDelete ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname") RegDelete ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname") RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Computername\Computername", "Computername", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername", "Computername", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AltDefaultDomainName", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", $CompName) RegWrite ("HKEY_USERS\.Default\Software\Microsoft\Windows Media\WMSDK\General", "Computername", "REG_SZ", $CompName) ; Change Workgroup with Netdom.exe RunWait (@TempDir & "Netdom.exe Member \\" & $CompName & " /JOINWorkgroup " & $Workgroup, "", @SW_HIDE) ; Remove needed files FileDelete (@TempDir & "NetDom.exe") MsgBox(0, "Done", "Computer was renamed to """ & $CompName & """ and workgroup was set to """ & $Workgroup & """.") GUICtrlSetState($inp_name, $GUI_ENABLE) GUICtrlSetState($inp_group, $GUI_ENABLE) GUICtrlSetData($set, "Set") GUICtrlSetState($set, $GUI_ENABLE) EndFunc ;==>Set_Names Func CLOSEClicked() Exit EndFunc ;==>CLOSEClicked That code requires Netdom.exe to exist in the same directory as the script when you compile it/run it, search on google, it's free, and it's only needed for changing the Workgroup name as well, so if you don't need that, just edit out the lines that use it, and have fun. Thanks to "SkinnyWhiteGuy", this is exactly what I've been looking for! the script works like a charm.
millenah6 Posted May 20, 2010 Posted May 20, 2010 Hi, I need some expert help and thanks for any feedback. I got this working under Vista x64. Now I created a php script to create a random name in 8 character bit as the computer name. I created an au3 to extract the random characters but I'm stuck integrating it into this code. What I wanted is that the computer is random and the workgroup is the same, and when this au3 or compiled exe is run it will change automatically. I hope I get my point across. I know this is easy for some but I'm new to autoit. Local $sData = InetRead("http://localhost/demo/changepcname.php") Local $nBytesRead = @extended MsgBox(4096, "", "Code: " & BinaryToString($sData)) and changepcname.php <?php $secret = 'some secret key here'; $hash = md5($secret . mt_rand()); echo substr(strtoupper(base64_encode($hash)),0,8); ?>
faldo Posted June 4, 2010 Posted June 4, 2010 (edited) expandcollapse popup;==================================================================================== ; Fix Computer Name & Workgroup Name Script ; by: tHe SkInNy WhItE GuY ; 03-06-2007 ;==================================================================================== ; Initialize Settings #include <GUIConstants.au3> #NoTrayIcon ; Initialize Variables Needed Dim $CompName, $Workgroup, $dir_create ; Build Forms to ask User for New Name and Workgroup Selection Box Opt("GUIOnEventMode", 1) $mainwindow = GUICreate("Name Changer", 200, 120) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Enter the name and workgroup to set on this computer", 10, 10, 180, 30) GUICtrlCreateLabel("Name", 10, 40, 70, 20) GUICtrlCreateLabel("Workgroup", 10, 60, 70, 20) $inp_name = GUICtrlCreateInput("", 80, 40, 100, 20) $inp_group = GUICtrlCreateInput("", 80, 60, 100, 20) $set = GUICtrlCreateButton("Set", 70, 90, 60) GUICtrlSetOnEvent($set, "Set_Names") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func Set_Names() ; Name & Workgroup Name $CompName = GUICtrlRead($inp_name, 1) $Workgroup = GUICtrlRead($inp_group, 1) GUICtrlSetState($inp_name, $GUI_DISABLE) GUICtrlSetState($inp_group, $GUI_DISABLE) GUICtrlSetData($set, "Updating...") GUICtrlSetState($set, $GUI_DISABLE) ; Install needed files onto the computer FileInstall ("NetDom.exe", @TempDir & "NetDom.exe", 1) ; Make some registry changes to also change the name now RegDelete ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname") RegDelete ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname") RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Computername\Computername", "Computername", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername", "Computername", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AltDefaultDomainName", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", $CompName) RegWrite ("HKEY_USERS\.Default\Software\Microsoft\Windows Media\WMSDK\General", "Computername", "REG_SZ", $CompName) ; Change Workgroup with Netdom.exe RunWait (@TempDir & "Netdom.exe Member \\" & $CompName & " /JOINWorkgroup " & $Workgroup, "", @SW_HIDE) ; Remove needed files FileDelete (@TempDir & "NetDom.exe") MsgBox(0, "Done", "Computer was renamed to """ & $CompName & """ and workgroup was set to """ & $Workgroup & """.") GUICtrlSetState($inp_name, $GUI_ENABLE) GUICtrlSetState($inp_group, $GUI_ENABLE) GUICtrlSetData($set, "Set") GUICtrlSetState($set, $GUI_ENABLE) EndFunc ;==>Set_Names Func CLOSEClicked() Exit EndFunc ;==>CLOSEClicked That code requires Netdom.exe to exist in the same directory as the script when you compile it/run it, search on google, it's free, and it's only needed for changing the Workgroup name as well, so if you don't need that, just edit out the lines that use it, and have fun. It seems that not any version of Netdom.exe works... the latest version doesn't even have the same syntax nor functionality to change workgroup. I did however find the version that works (v1.8) ftp://ftp.microsoft.com/reskit/nt4/x86/ cheers! Edited June 4, 2010 by faldo Check out my other scripts: RDP antihammer/blacklist generator | Phemex cryptocurrency exchange API
RagsRevenge Posted August 5, 2010 Posted August 5, 2010 expandcollapse popup;==================================================================================== ; Fix Computer Name & Workgroup Name Script ; by: tHe SkInNy WhItE GuY ; 03-06-2007 ;==================================================================================== ; Initialize Settings #include <GUIConstants.au3> #NoTrayIcon ; Initialize Variables Needed Dim $CompName, $Workgroup, $dir_create ; Build Forms to ask User for New Name and Workgroup Selection Box Opt("GUIOnEventMode", 1) $mainwindow = GUICreate("Name Changer", 200, 120) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Enter the name and workgroup to set on this computer", 10, 10, 180, 30) GUICtrlCreateLabel("Name", 10, 40, 70, 20) GUICtrlCreateLabel("Workgroup", 10, 60, 70, 20) $inp_name = GUICtrlCreateInput("", 80, 40, 100, 20) $inp_group = GUICtrlCreateInput("", 80, 60, 100, 20) $set = GUICtrlCreateButton("Set", 70, 90, 60) GUICtrlSetOnEvent($set, "Set_Names") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func Set_Names() ; Name & Workgroup Name $CompName = GUICtrlRead($inp_name, 1) $Workgroup = GUICtrlRead($inp_group, 1) GUICtrlSetState($inp_name, $GUI_DISABLE) GUICtrlSetState($inp_group, $GUI_DISABLE) GUICtrlSetData($set, "Updating...") GUICtrlSetState($set, $GUI_DISABLE) ; Install needed files onto the computer FileInstall ("NetDom.exe", @TempDir & "NetDom.exe", 1) ; Make some registry changes to also change the name now RegDelete ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname") RegDelete ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname") RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Computername\Computername", "Computername", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername", "Computername", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AltDefaultDomainName", "REG_SZ", $CompName) RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", $CompName) RegWrite ("HKEY_USERS\.Default\Software\Microsoft\Windows Media\WMSDK\General", "Computername", "REG_SZ", $CompName) ; Change Workgroup with Netdom.exe RunWait (@TempDir & "Netdom.exe Member \\" & $CompName & " /JOINWorkgroup " & $Workgroup, "", @SW_HIDE) ; Remove needed files FileDelete (@TempDir & "NetDom.exe") MsgBox(0, "Done", "Computer was renamed to """ & $CompName & """ and workgroup was set to """ & $Workgroup & """.") GUICtrlSetState($inp_name, $GUI_ENABLE) GUICtrlSetState($inp_group, $GUI_ENABLE) GUICtrlSetData($set, "Set") GUICtrlSetState($set, $GUI_ENABLE) EndFunc ;==>Set_Names Func CLOSEClicked() Exit EndFunc ;==>CLOSEClicked That code requires Netdom.exe to exist in the same directory as the script when you compile it/run it, search on google, it's free, and it's only needed for changing the Workgroup name as well, so if you don't need that, just edit out the lines that use it, and have fun. A couple of minor additions to improve SWG's code are a validity check to ensure that you're not trying to set a computer name with illegal characters. I believe the following covers all of the illegal characters if StringRegExp($name, '\\|/|:|\*|\?|"|<|>|\.|,|~|!|@|#|\$|%|\^|&|\(|\)|\;|{|}|_|=|\+|\[|\]|\x60' & "|'", 0) = 0 Then MsgBox(0,"", "Legal") endif \x60 is the italicised ' As part of my project, I also need to set the Computer Description to be the same as the computer name. RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "srvcomment", "REG_SZ", $CompName) Both have been tested in Windows XP. One minor prob I'm having is that the Computer Description isn't being updated until I reboot. If anybody has any tip to get that to refresh immediately, it would be appreciated.
wraithdu Posted August 10, 2010 Posted August 10, 2010 (edited) I'm not sure if you are interested, but all this can be done very cleanly through WMI. There's documented functions for it and everything. But you will always require a reboot if you change anything related to the computer name or description. I think you can get away with changing workgroup/domain without a restart though. I just finished a project doing this exact thing (changing computer name/workgroup/dhcp settings) for computers we image in our corporate computer lab. We run CloneZilla and needed an alternative to sysprep. I used DRBL-Winroll for a while, but it's a 120MB installation because of the Cygwin requirement. I wrote the same thing in AutoIt using SrvAny in about 400KB. Edited August 10, 2010 by wraithdu
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