Jump to content
Sign in to follow this  

Disconnect and then reconnect again?

Recommended Posts


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.


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"')


Share this post

Link to post
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:



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  

  • Create New...