AFAIK there are no DOS commands to "press a function key". You'd need a third-party program.
There used to be little third-party DOS utilities floating around years ago to toggle [NumLock] and [CapsLock] On/Off, press [PrintScreen], and a couple of "press the [Enter] key" once or twice. But I don't believe I remember seeing any that would "press a function key".
I know this is an old thread, but the info may still be useful to someone.
There's an old, (and great), set of old DOS commands that are still available online, from Horst Schaffer. I consider these tools to be indispensable for my DOS machine.
Click on this link, then click on the "PBATS" button at the bottom. "KPUSH" is the relevant command for this question, but all of the commands are useful.
Bookmarks