Jump to content
Sign in to follow this  

Default Gateway, need to convert my batch script into AutoIT...

Recommended Posts


Hi guys,

Here is my code that I have been using in most of my batch scripts to obtain default gateway and do simple if a equals b do c etc.

for /f "tokens=2 delims=:" %%i in ('"ipconfig | findstr Gateway | findstr 10."') do set GW=%%i
if "%GW%"=="" set SITECODE=BHR

Does anyone have any idea on how to push these two lines into AutoIT? I have seen few topics talking about default gateway and how to get it but most scripts are 15+ lines which doesn't seem right.

I would really appreciate some help.



Share this post

Link to post
Share on other sites

if the autoit code works, what difference does it make if it is 15 lines? a couple of milliseconds? not a big deal. Just use the examples you found and code it the AutoIt way. If you like the shortness of your batch way then just use RunDOS

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.