Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Thanks.

share|improve this question
1  
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
add comment

2 Answers

up vote 0 down vote accepted

Yeah, you can whip up a VBScript and use SendKeys. Then you use cscript myscript.vbs. Example: http://www.computerperformance.co.uk/ezine/ezine26.htm. This doesn't use function keys but that's just e.g. {F4}. More info on what you can do here: http://www.techrepublic.com/article/automate-tasks-with-windows-script-hosts-sendkeys-method/1056137

You could also use PowerShell: http://technet.microsoft.com/en-us/library/ff731008.aspx

share|improve this answer
add comment

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 http://www.autohotkey.com/ 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
add comment

Your Answer

 
discard

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.