somone else might know of a way to do this, but in DOS most of the F-keys are already assigned to commands related to that system.
for example F3 repeats the last DOS command you used (i.e. dir/w gives you a wide view of your current directory, if you hit F3 it repeats the command dir/w and waits for you to hit enter)
those command overrides, which is what you are wanting to do, are usually scripted into the programs when created. You can download a program called F-Keys 1.3
which will allow you assign keys, its a TSR (To Stay Resident) Program and is shareware so there could be a fee associated with it to unlock its full potential.
below I have listed what the current assignments for the F-Keys.F1
: Repeats the letters of the last command line, one by oneF2
: Displays a dialog asking user to "enter the char to copy up to" of the last command lineF3
: Repeats the last command lineF4
: Displays a dialog asking user to "enter the char to delete up to" of the last command lineF5
: Goes back one command lineF6
: Enters the traditional CTRL+Z (^z)F7
: Displays a menu with the command line historyF8
: Cycles back through previous command lines (beginning with most recent)F9
: Displays a dialog asking user to enter a command number, where 0 is for first command line enteredF10