Using Task Scheduler to realize the disconnection of Internet card

Source: Internet
Author: User

Due to the need to do some server maintenance, in order to facilitate maintenance, on the server installed a 4G wireless internet card. But because of the network instability, often in the use of a two days after the disconnection, unable to remotely connect, is very distressed. On the internet for a long time have not found any good solution.

Just today, web search found a post "standby wake up automatically connect broadband", and I want to solve the problem has the same feeling, so I tried a try, really good, and quickly share to everyone.

1, first create a new text file, write the following VBS code, and save as a VBS file;

CreateObject ("wscript.shell"). Run"rasdial broadband connection name User name password ",0

This line of code enables dialing for a specified broadband connection. I here wireless on the network card, no user name password, directly fill in the broadband name on the line, save as Cmiot.vbs.

CreateObject ("wscript.shell"). Run"rasdial cmiot",0

2, new task plan, automatically redial when the network is disconnected;

Inspired by this article, "Using Python to control DDNS parsing," The system event is observed when the connection to the Internet card is disconnected.

As you can see, the ISATAP interface generates new events each time the network is connected and disconnected, and the event IDs are 4200 and 4201, which is good, we only need to run the Cmiot.vbs program when the ISATAP interface generates the 4201 event to enable the wire break redial.

Create a new Task Scheduler, trigger select "When a specific event is logged", the trigger content is filled out as follows, the action select "Start Program", and select the first step saved VBS file, complete.

3. Measured effect

Disconnect the network for testing, and sure enough, immediately after the 4201 incident, escalate the 4200 event, and the network automatically connects successfully.

Using Task Scheduler to realize the disconnection of Internet card

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.