Jump to content

Want to make a script that changes IP/gateway/DNS

Recommended Posts

I started out with a GUI script that used the input from a combobox to call the command "netsh" and use those variables, but netsh doesn't work very well. I was wondering if anyone had a more elegant solution for me to change a user IP/DNS/Gateway/Mask, etc. through an AutoIT scripted windows commmand?

Thanks in advance,


Link to post
Share on other sites

Oh, not much. Not only have I not totally gotten the syntax down, I can't seem to pass more than one argument at a time-

c:\> "netsh"


c:\netsh> "set"

etc, when I'd like to give one long argument like:

set address name="Local Area Connection" source=static addr= mask= gateway=

which is what I came up with after looking at the command structure in the help file. I've mainly been looking throught the MS database help files, but the commands seem to have changed a bit. Any advice?

Link to post
Share on other sites

Hot damn it worked! Thanks for the link also, it helped. Lastly, is it possible to pass a variable to the Run() line, for instance

Run('netsh interface ip set address name="Local Area Connection" static $VARIABLE1&$VARIABLE2 $VARIABLE3')

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...