bstripe Posted September 20, 2006 Share Posted September 20, 2006 I need a program that will change a computer name and an IP address. I want the user to choose from two possiblilities. For example: Computer Name: Inbatch1 IP address 111.1.1.1 or Computer Name: Inbatch2 IP address 222.2.2.2 This will run on WinNT 4.0 but if I knew how to do it on Windows XP I should be able to make any needed alterations. Thanks Link to comment Share on other sites More sharing options...
bstripe Posted September 21, 2006 Author Share Posted September 21, 2006 I created two buttons with logic as follow: case $msg = $Inbatch1_btn RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName", "ComputerName","REG_SZ", "Inbatch1") RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", "Inbatch1") RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", "Inbatch1") RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", "Inbatch1") RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\El90x1\Parameters\Tcpip","IPAddress","Reg_Binary","111.1.1.1")Exit case $msg = $Inbatch2_btn RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName", "ComputerName","REG_SZ", "Inbatch2") RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", "Inbatch2") RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", "Inbatch2") RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", "Inbatch2") RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\El90x1\Parameters\Tcpip","IPAddress","Reg_Binary","32,32,32,2e,32,2e,32,2e,32,00,00") Exit The computer name changes but not the IP address. In the RegWrite command I have tried entering the value as shown as well as the form "111.1.1.1". As shown the registry is updated but when I go to TCP/IP properties, the IP address is blank. When I change the value using the other form ("111.1.1.1") it does not change the value in the properties or registry. If I do a RegRead then the current IP address shows up in the form "111.1.1.1" Link to comment Share on other sites More sharing options...
Danny35d Posted September 21, 2006 Share Posted September 21, 2006 To change the IP address you are better off using NETSH command line, is part of WinXP. Windos XP Professional DocumentationThis is a script by ACalcutt called IPSet.... AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
bstripe Posted September 21, 2006 Author Share Posted September 21, 2006 I checked Netsh out and it would work great for Windows XP and 2000, but unfortunately it is not available for Windows NT Link to comment Share on other sites More sharing options...
Danny35d Posted September 21, 2006 Share Posted September 21, 2006 It will be a little tricky to do it but this link should give you all the need it information. AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
bstripe Posted September 21, 2006 Author Share Posted September 21, 2006 (edited) Danny, Since there were only two IP configurations, I was able to make *.reg files for the two IP addresses and then I just opened them using the run command. run("regedit.exe filepath\filename") Thanks for your input. Brett Edited September 21, 2006 by bstripe 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