The AutoRun Key

Prev Next Home Home Table Of Contents Index

THE AUTORUN KEY [F2]

Just like the Programmable Function Keys, the AutoRun Key has the capability of executing a program or a DOS command on a selected file in one keystroke.

The AutoRun Key is different from the Programmable Function Keys. You can use the same key to run any number of programs, or execute any number of DOS commands. You only have to remember one key --- [F2].

The important difference between the AutoRun Key and the Programmable Function Keys is that the AutoRun Key looks at the extension of the file at the pointer, and executes a DOS command that you have programmed to run on all files with that extension.

Suppose you program the AutoRun Key to run BASIC and load the file which has a .BAS extension. If you positioned the pointer next to a file named (for example) ALIENS.BAS and pressed the AutoRun (F2) Key, the BASIC program will execute and automatically load ALIENS.BAS.

The AutoRun Key won't automatically work for your software. You must program this key before it will work. If the key isn't programmed, nothing will happen when you press it.

When you press the AutoRun Key, the computer will look at the extension of the file next to the pointer and execute the command you have designated for a file with that extension.

The first step to custom programming the AutoRun Key is to make a list (on paper) of the extensions of files you want to execute programs on. Next, write a DOS command to correspond with each extension. See examples later in this section.

You will need to use variables in the commands, like you did when you programmed the Function Keys (see above). The following are valid variables for use in DM:


          {F} = FileName             {P} = Path
          {T} = Type in Text         {D} = Drive
          {N} = Name no Ext          {E} = Ext no Name
          {S} = Allow Program to Change Subdirectory
          {A} = Press Any Key to Return to DM

Suppose you want to program your AutoRun key ([F2]) to run BASIC, and load the file next to the pointer. You may remember the command that we used in the example for the Programmable Function Keys: C:BASIC {F}

Since the AutoRun Key looks only at the extension, you will program your commands a little differently than you did with the Function Keys. Using the following format


             Extension=DOS command

the command for your BASIC program would be


             BAS=BASIC {F}

You may program the AutoRun Key ([F2]) to execute any DOS command. The command will be executed on the file at the pointer.

Suppose you have the word processing program WORDSTAR. WORDSTAR creates backup files with the extension .BAK. If you don't want to keep backup copies set up the command:


             BAK=DEL {F}

If you positioned the pointer at a file named LETTER.BAK and pressed [F2], LETTER.BAK would be automatically deleted because it has a .BAK extension.

Suppose you set up the command COM={F}. What would happen if you placed the pointer next to a file called PACKMAN.COM and pressed [F2]? That's right, PACKMAN.COM would run.

Remember, if you can't do it from the DOS command line, you can't do it from within DM. For example, you cannot RUN a file like CONFIG.SYS. Test your commands directly from DOS, so that you will be sure that they work. (You can use [F4] to test them within DM).

When you have tested all your commands, and have written them in the "Extension=DOS command" format, you are ready to enter them into DM.

For practice, let's enter the three examples given above.


             BAS=BASIC {F}
             BAK=DEL {F}
             COM={F}

Press the F8 (Edit Commands) key. Pick option #4 "Change AutoRun Commands." The following will appear on the screen:


        ====================================
        |     Edit AutoRun Strings
        |
        |
        |
        |

Type in the commands. Use the arrow keys to move around the screen and the backspace key to correct mistakes.


        ====================================
        |     Edit AutoRun Strings
        | BAS=BASIC {F}
        | BAK=DEL {F}
        | COM={F}
        |

Press Esc when you are finished typing commands. Test them when you are finished. If the commands do what you want you are ready to save the changes. If you don't save them, they won't be there next time you use DM. However, once they're saved, they can't be accidentally changed until you "save" something new.

To save your AutoRun commands, press F8, then choose option "5" (Save to DM.OVL). Your changes will be saved to disk.

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home