run without full path

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
ima18h
Posts: 4
Joined: 18 Mar 2023, 10:42
Contact:

run without full path

03 Dec 2023, 21:50

from run documentation:
Some programs have their paths registered with the system, in which case you can get away with just passing the filename of the program, with or (sometimes) without the ".exe" extension. For example:
Run "notepad"

i havent tried running firefox with full path yet.

Run "msedge"
works as expected.

Run "firefox"
does some weird shit, gives an error and gives me a dialog to press refresh, then i have to press restore all tabs, as if firefox closed badly. firefox resets what i think is all settings that are not synced by account when opened after the manual clicks.

anyone know why this is happening?
how can i register firefox with windows, so that i dont have to give a full path and have it work normally?


[Mod edit: removed Codebox tags from around entire post text.]
User avatar
mikeyww
Posts: 27283
Joined: 09 Sep 2014, 18:38

Re: run without full path

03 Dec 2023, 22:31

Would try it this way.

Code: Select all

#Requires AutoHotkey v2.0
Run A_ProgramsCommon '\Firefox.lnk'
ima18h
Posts: 4
Joined: 18 Mar 2023, 10:42
Contact:

Re: run without full path

04 Dec 2023, 08:52

mikeyww wrote:
03 Dec 2023, 22:31
Would try it this way.

Code: Select all

#Requires AutoHotkey v2.0
Run A_ProgramsCommon '\Firefox.lnk'
Nevermind, this is not needed. using Run "firefox" works fine.

The problem was that my script was using a combination with shift key to be triggered, which means firefox was ran while pressing shift. this start firefox in troubleshoot mode.

i use for example KeyWait("Shift") now to wait for pressed keys to be released.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: lexikos and 31 guests