Clever Use of DOSKey
DOSKey is a commonly used memory-resident program under MS-DOS. Its main functions are: recording typed commands in a memory buffer and turning command sequences into macros.
DOSKey is usually added to the batch file AUTOEXEC.BAT, that is, add DOSKey or LH DOSKey to the command line in AUTOEXEC.BAT. You can also type DOSKey or LH DOSKey directly under MS-DOS to start it. After DOSKey is installed, you can conveniently and quickly find, use, and modify commands typed previously. Below is a brief introduction to several ways to use DOSKey:
First: Find, display, and edit a DOS command:
For commands just typed, you can use the ↑ or PageUP and ↓ or PageDown keys to find them; for commands typed earlier, you can use F7 to display the command list, then use F9 to enter the number of the command in the list. While searching, DOSKey allows you to edit and modify the current command line by moving the cursor with the ← and → keys. During editing you can also use the Insert key to switch between character insert and overwrite modes.
Second: Enter multiple commands at the same time:
Using DOSKey, you can type multiple commands on the same command line, separating each command with "Ctrl + T". The command format is:
DOSKey command1 "Ctrl + T" command2 "Ctrl + T" command3
For example, at the DOS prompt type:
C:\>cd mydocu~1 "Ctrl + T" dir *.doc/w "Ctrl + T" dir *.xls
After pressing Enter, the three commands entered will be displayed and executed in sequence.
Third: Create a batch file:
Everyone knows that batch files can be created with copy con:, Edit, and other methods. Now let me tell everyone that for some not-too-long batch files, they can also be created entirely with DOSKey. This method uses DOSKey's /history command to input the records in the list into a BAT file.
First, press "Alt + F7" to clear the record buffer in memory; then type the required batch contents. For example, at the DOS prompt type:
C:\>CLS
C:\>CD \WINDOWS\TEMP
C:\WINDOWS\TEMP>SUBST B: .
C:\WINDOWS\TEMP>CD..
C:\WINDOWS>DOSKey /history > setb.bat
This saves the above commands in setb.bat. Finally, use a text file editor (such as: EDIT) to delete the last line, "DOSKey /history >setb.bat". After that, as long as you run setb.bat, you can create a virtual B drive.
Fourth: Use DOSKey to create macros:
With DOSKey, you can create some commonly used groups of DOS commands as a macro.
The command format is:
DOSKey name(macro name)=command1 $t command2 $t etc.,(command group)
Each command in the command group is separated with $t. For example, type:
C:\>DOSKey aut=dir *.exe/p $t dir *.com/p $t dir *.bat/p
Press Enter. Later, you only need to type aut to display all executable files in the current directory.
Macros can also use replaceable parameters like batch files; the parameter is $n, where n=1~9. For example: C:\>dos
key hmy=md $1$t cd $1
This macro replaces the two DOS commands md and cd. You only need to use hmy Content(directory name) to create a directory and enter that directory at the same time.
Since macros are stored in memory, they will be lost after shutting down. However, you can add these commonly used macros to the command line in AUTOEXEC.BAT, which will make them very convenient to use in the future.
DOSKey also has many options and command editing keys. If you need detailed information, you can type DOSKey/help or DOSKey/? to query.
DOSKey is a commonly used memory-resident program under MS-DOS. Its main functions are: recording typed commands in a memory buffer and turning command sequences into macros.
DOSKey is usually added to the batch file AUTOEXEC.BAT, that is, add DOSKey or LH DOSKey to the command line in AUTOEXEC.BAT. You can also type DOSKey or LH DOSKey directly under MS-DOS to start it. After DOSKey is installed, you can conveniently and quickly find, use, and modify commands typed previously. Below is a brief introduction to several ways to use DOSKey:
First: Find, display, and edit a DOS command:
For commands just typed, you can use the ↑ or PageUP and ↓ or PageDown keys to find them; for commands typed earlier, you can use F7 to display the command list, then use F9 to enter the number of the command in the list. While searching, DOSKey allows you to edit and modify the current command line by moving the cursor with the ← and → keys. During editing you can also use the Insert key to switch between character insert and overwrite modes.
Second: Enter multiple commands at the same time:
Using DOSKey, you can type multiple commands on the same command line, separating each command with "Ctrl + T". The command format is:
DOSKey command1 "Ctrl + T" command2 "Ctrl + T" command3
For example, at the DOS prompt type:
C:\>cd mydocu~1 "Ctrl + T" dir *.doc/w "Ctrl + T" dir *.xls
After pressing Enter, the three commands entered will be displayed and executed in sequence.
Third: Create a batch file:
Everyone knows that batch files can be created with copy con:, Edit, and other methods. Now let me tell everyone that for some not-too-long batch files, they can also be created entirely with DOSKey. This method uses DOSKey's /history command to input the records in the list into a BAT file.
First, press "Alt + F7" to clear the record buffer in memory; then type the required batch contents. For example, at the DOS prompt type:
C:\>CLS
C:\>CD \WINDOWS\TEMP
C:\WINDOWS\TEMP>SUBST B: .
C:\WINDOWS\TEMP>CD..
C:\WINDOWS>DOSKey /history > setb.bat
This saves the above commands in setb.bat. Finally, use a text file editor (such as: EDIT) to delete the last line, "DOSKey /history >setb.bat". After that, as long as you run setb.bat, you can create a virtual B drive.
Fourth: Use DOSKey to create macros:
With DOSKey, you can create some commonly used groups of DOS commands as a macro.
The command format is:
DOSKey name(macro name)=command1 $t command2 $t etc.,(command group)
Each command in the command group is separated with $t. For example, type:
C:\>DOSKey aut=dir *.exe/p $t dir *.com/p $t dir *.bat/p
Press Enter. Later, you only need to type aut to display all executable files in the current directory.
Macros can also use replaceable parameters like batch files; the parameter is $n, where n=1~9. For example: C:\>dos
key hmy=md $1$t cd $1
This macro replaces the two DOS commands md and cd. You only need to use hmy Content(directory name) to create a directory and enter that directory at the same time.
Since macros are stored in memory, they will be lost after shutting down. However, you can add these commonly used macros to the command line in AUTOEXEC.BAT, which will make them very convenient to use in the future.
DOSKey also has many options and command editing keys. If you need detailed information, you can type DOSKey/help or DOSKey/? to query.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos


