Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Are there commands to invoke function key commands from a command prompt? I would like to script something that I can't find command line options for. Also, I don't want to install another app, like autohotkey, etc.

Windows 7 Home Premium, 64 bit


share|improve this question
Perhaps specify what it is you're trying to do? There may be a better way (i.e.: PowerShell, as suggested by @MarkSowul). – Iszi Mar 16 '11 at 16:28
up vote 0 down vote accepted

Yeah, you can whip up a VBScript and use SendKeys. Then you use cscript myscript.vbs. Example: This doesn't use function keys but that's just e.g. {F4}. More info on what you can do here:

You could also use PowerShell:

share|improve this answer

This is probably not the most elegant answer to your question, but I'll introduce you to it as you may find it a pragmatic solution to what you're doing or useful elsewhere. Look at This program is more about using a script that performs certain tasks when it detects things like a keypress or mouse movement, but I'm sure you could write a script that will initiate the sending of keys. You'll also find a bunch of useful prewritten scripts on their site.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.