Reconnecting a PPPOE Connection

I have a PPPOE connection on a computer. This computer has two LAN cards, and I activated ICS. The problem is that the connection worsens over time (I don’t know why), and redialing will be pleasant, hourly, maybe. I was thinking of writing an AutoIT script that would do this if, for example, I send some data to the port that the computer is listening on. The only problem: I do not know what name of the executable file I will need to run. Can anybody help me?

EDIT: I'm interested in the graphical interface.

EDIT 2: I am interested in automating this process and would not like to write a thing in AutoIT (this is the last option). If you could post some piece that I could use, you will win the award.

Thank!

+3
source share
2 answers

you can use rasdial (which is built into windows) and create a batch script (.bat extension) like this:

rasdial connectionname

-or-

if you want to do this in a programming language, you can just call the command inside

C # example:

public static int OpenConnection(string connectionName, int Timeout) {
   int ExitCode;
   ProcessStartInfo ProcessInfo;
   Process Process;

   ProcessInfo = new ProcessStartInfo("cmd.exe", "/C rasdial " + connectionName);
   ProcessInfo.CreateNoWindow = true; 
   ProcessInfo.UseShellExecute = false;
   Process = Process.Start(ProcessInfo);
   Process.WaitForExit(Timeout);
   ExitCode = Process.ExitCode;
   Process.Close();

   return ExitCode;
}

and I guess your desired language will have something like this.

oh and you can use:

rasdial "connection name" /d 

to remove the connection.

+3
source

Perhaps you can do something for yourself rasdial and in ?

+1
source

All Articles