With AutoHotkey on Windows you can associate a shortcut to open a URL - web page or link - in the default browser with the following script:

^!g::Run https://mail.google.com/

This will open Gmail in a new tab in the last active window when pressing CTRL+ALT+G.

How can I do same, but open the URL in a new window instead?

  • 1
    You need to pass the appropriate command line switch for your default browser. – DavidPostill Mar 3 '19 at 12:27
  • What is your browser? – harrymc Mar 3 '19 at 13:06
  • @harrymc Chrome, but I what I was actually looking for is a general solution which would work with any browser – Marco Lackovic Mar 4 '19 at 8:39


Run, iexplore.exe https://mail.google.com/


Run chrome.exe "https://mail.google.com/" " --new-window "


Run, firefox.exe -new-window https://mail.google.com/

In AutoHotkey v2 Alpha


Run "chrome.exe " "https://www.google.com" " --new-window "

Firefox :

Run "firefox.exe " "-new-window www.google.com/"

Microsoft Edge

Run "msedge.exe www.google.com/ --new-window"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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