Sign in to follow this  
Followers 0
TimBS

Ip Change

8 posts in this topic

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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

Thanks for your help, but I am not familiar with netsh. Can you give me some extra help on the command I would use

Share this post


Link to post
Share on other sites

Thanks for the help with netsh --- it worked great on my 2000 machine. Next problem is how do I change the IP on an NT or Win 9x machine

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Finally all solved by using REG.exe from the NT Resource kit. Thanks for the help

Tim :D

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