1

Is there a way to set the focus to an already opened window using cmd/batch? It should act just like clicking the task bar icon. Or like double-clicking the window in Task-Manager. I know there are many similar questions, but i couldn't find an answer to this "simple" task, I just can't imagine this is to be so difficult to do...

example: I have Outlook opened somewhere in the background. When executing the command, the open window should come to the front. If no window is open, it should open a new one.

What i tried:

  • start outlook

    -> this will always open a new window

  • start outlook /[non-existing command]

    -> this is the only way i found to get the focus on an open window, followed by an error since it doesn't know the command, but Outlook does not open unless it's already running. An option might be, to tell Outlook not to do anything?

  • AFAIK, there is no windows native way (not sure about VBS or PS). Try to search for some external utility. – user2956477 Mar 30 '20 at 16:53
  • See the answers to this question. https://stackoverflow.com/q/42566799/447901 – lit Mar 30 '20 at 17:06
  • Does this answer your question? [How to bring focus to window by process name?](https://stackoverflow.com/questions/42566799/how-to-bring-focus-to-window-by-process-name) – lit Mar 30 '20 at 17:07

0 Answers0