Jump to content

Disconnect and then reconnect again?


Recommended Posts

Hello!

Is it possible to disconnect the internet and reconnect it again in AutoIt and if it is possible please ell me some functions I should look up.

Thanks

I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.

Link to comment
Share on other sites

Hello!

Is it possible to disconnect the internet and reconnect it again in AutoIt and if it is possible please ell me some functions I should look up.

Thanks

Try with Run("ipconfig.exe /renew"). This renews IP (resets connection)

You can also use /release parameter to disconnect (flush IP) and /renew to reconnect.

Note: this works for all adapters. Otherwise enter something like Run('ipconfig.exe /renew "Local Area Connection"')

:)

I can do signature me.

Link to comment
Share on other sites

if you use dial up authentication method maybe this will help you:

#include <Constants.au3>
Run(@ComSpec & " /c " & "rasdial /disconnect", "", @SW_HIDE ,$STDERR_CHILD + $STDOUT_CHILD);disconnect
$connecton_name = "ADSL_INTERNET"
$Connection_username = "username"
$connection_password = "password"
Run(@ComSpec & " /c " & "rasdial " & $connecton_name & " " & $Connection_username _
                & " " &  $connection_password, "", @SW_HIDE ,$STDERR_CHILD + $STDOUT_CHILD);connect

and for $connection_name you can see scriptomatic's WMI to retrieve your connection's name, or maybe even this can help you:

http://www.autoitscript.com/forum/index.ph...amp;hl=internet

http://www.autoitscript.com/forum/index.ph...9535&hl=wmi

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...