I know I can create custom keyboard shortcuts in Windows (7 and XP, at least) by creating a new shortcut to a program, navigating to Properties on the file shortcut, and setting the "Shortcut Key" field. Strangely, however, when this keyboard shortcut is invoked, it does not always spawn a new instance of the program. Rather, if a program instance is not already spawned, it will spawn a new instance; and if a program instance is already spawned, then it will focus that window.

How can I make a windows keyboard shortcut that spawns a new instance of the linked program, regardless of whether there is already a running instance of the linked program?

link|improve this question

50% accept rate
Is this behavior identical for all programs? – Daniel Beck Dec 22 '11 at 6:36
Does it happen to applications for which you are able to open multiple instances otherwise ? – Shakehar Dec 22 '11 at 6:41
This happens for all the programs I've tested, including cygwin and notepad. – jbeard4 Dec 22 '11 at 6:45
feedback

1 Answer

up vote 2 down vote accepted

I seem to be the AutoHotkey ambassador here on Superuser. Here is a simple script to launch a new process each time:

#n::
Run notepad.exe
Exit
  • #n:: is the keyboard shortcut; e.g. Windows+N.
  • Run opens an external program; e.g. notepad.exe
  • Exit ends the current thread/script.
link|improve this answer
That's the way to do it! – jbeard4 Dec 22 '11 at 7:01
Did you try it? I tested it a bit, and it created a new process each time. Let me know if you find out otherwise. :) – iglvzx Dec 22 '11 at 7:03
feedback

Your Answer

 
or
required, but never shown

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