Jump to content

Ip Change


 Share

Recommended Posts

Can Anyone help

:whistle: I still need some help changing the IP address on a local PC

The code I have used for IP example of 66.33.4.60 on a WinNT machine is

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\E100B6\Parameters\Tcpip", "IPAddress","REG_BINARY","336362E33332E342E3630")

The registry looks right but when I look at the IP under the network protocol the previous IP has been overwritten with spaces.

I would also like to do this job on Win 95,98 and 2000 PCs

Thanks

Link to comment
Share on other sites

look into using netsh on win2k

[quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote]

Link to comment
Share on other sites

Hi Tim,

Try this. copy paste to text editor and name it something.vbs

Dim WSHShell, NList, N, IPAddress, IPMask, DefaultGateway, IPValue, RegLoc

Set WSHShell = WScript.CreateObject("WScript.Shell")

RegTCP = "HKLM\System\CurrentControlSet\Services\VxD\MSTCP\"

Domain = RegTCP & N & "\Domain"

EnableDNS = RegTCP & N & "\EnableDNS"

HostName = RegTCP & N & "\HostName"

NameServer = RegTCP & N & "\NameServer"

WSHShell.RegWrite Domain,""

WSHShell.RegWrite EnableDNS,"0"

WSHShell.RegWrite HostName,""

WSHShell.RegWrite NameServer,""

NList = array("0000","0001","0002","0003","0004","0005","0006", _

"0007","0008","0009","0010")

On Error Resume Next

RegLoc = "HKLM\System\CurrentControlSet\Services\Class\NetTrans\"

For Each N In NList

IPValue = "" 'Resets variable

IPAddress = RegLoc & N & "\IPAddress"

IPMask = RegLoc & N & "\IPMask"

DefaultGateway = RegLoc & N & "\DefaultGateway"

IPValue = WSHShell.RegRead(IPAddress)

If (IPValue <> "") and (IPValue <> "0.0.0.0") then

WSHShell.RegWrite IPAddress,"0.0.0.0"

WSHShell.RegWrite IPMASK,"0.0.0.0"

WSHShell.RegWrite DefaultGateway,""

end If

Next

WScript.Quit ' Tells the script to stop and exit.

Good luck

Driss

Link to comment
Share on other sites

Hi,

Thanks for the code for Win 9X. With the supplied help I have now got Win 2000 and Win 9X working great. I have only one to go ie WinNT. Any chance of help here? Obviously, none of the previously supplied solutions will work.

Cheers Tim :D

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...