Jump to content
Sign in to follow this  
tekhed

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

Recommended Posts

tekhed

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,

Mike

Share this post


Link to post
Share on other sites
tekhed

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>

c:\netsh> "set"

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

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

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?

Share this post


Link to post
Share on other sites
tekhed

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 255.255.255.0 $VARIABLE3')

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  

×