Sign in to follow this  
Followers 0
TimBS

IP Address and Gateway change

2 posts in this topic

Hi,

I'm still trying to change IP Addresses. I've got most of it working, but fail when I attempt to change the gateway. I can do the change when I do the job manually, but not within my script.

My Code for Win 2000 is:

RunWait(@comspec & " /c netsh interface IP set address local static 10.00.0.9 255.0.0.0 10.0.0.1 1","",@SW_HIDE)

IP Address = 10.00.0.9

mask = 255.0.0.0

Gateway = 10.00.0.1

This example is from the help within netsh

Can anyone suggest what I am doing wrong

Thanks

Share this post


Link to post
Share on other sites



Time ago, I had the same problem.

I don't sure why Run(...) function don't set the values, like when is changed manually in the prompt. :D

But, I solved running a script with exec, first generate (FileWriteLine) a dump file, with your values(IPs), like this output:

netsh -c interface dump > C:\example.txt

After, run the output file:

netsh exec $yourFile

Hope it helps. :huh2:

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