Sign in to follow this  
Followers 0
bstripe

Change Computer Name and IP Address

6 posts in this topic

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

Share this post


Link to post
Share on other sites



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"

Share this post


Link to post
Share on other sites

I checked Netsh out and it would work great for Windows XP and 2000, but unfortunately it is not available for Windows NT

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by bstripe

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0