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