Batch file application

Source: Internet
Author: User
Let's take a look at how to enable a program with the startup of another program. A typical application is to enable anti-virus software to run automatically as the network connection is enabled. When the network connection is disabled, the anti-virus software automatically exits. Disabling network connections at any time also saves network fees and prevents attacks. The implementation method is as follows:
Step 1 determine the location of the phase program

The network connection software pppoewin.exeand kvxp.kxp( the extension name is not .exe or. com, but can still run) are located in C:/Windows/system32 and C:/kv2004 respectively. If you use dial-up Internet access, the program that starts it is rasphone, which is located in C:/Windows/system32.

Step 2 create a batch file

Assume that the batch processing file name is "mypppoe. Bat" and the batch processing contains the following command lines:

@ Echo off

Start C:/Windows/system32/pppoewin

Start C:/kv2004/kvxp. KXP

Later, as long as the batch processing is run and the Network Connection Program is opened, the anti-virus software automatically opens.

Note:

① Kvxp. KXP must be added with an extension to run, because it does not have an executable file extension in DOS.

When there is a space in the C:/program files/Internet assumerdirectory in the directory, the batch processing will fail to find the iexplore.exe error, you can modify the batch processing:

@ Echo off

PATH %; C:/program files/Internet Explorer

Start iexplore.exe

Start C:/kv2004/kvxp. KXP

Morning Breeze prompt: We can also let the network connection and anti-virus software exit at the same time. You only need to create a batch file that contains the following content:

Start taskkill/f/IM kvxp. KXP

Start taskkill/f/IM pppoewin.exe

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.