When started with autohotkey, the application doesn't load the configuration file Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Rostov
Posts: 129
Joined: 09 Apr 2020, 07:57

When started with autohotkey, the application doesn't load the configuration file

Post by Rostov » 16 Jan 2022, 15:32

I use the following hotkey to run the Ivacy VPN client.

Code: Select all

<^>!1::
        Thread, NoTimers, True
        Run C:\Program Files (x86)\Ivacy\Ivacy.exe
return 
The problem is that when I run Ivacy this way, my favorite VPN server list isn't loading. When I start Ivacy by clicking the mouse on the file icon whose location I entered in the hotkey, the list of my favorite VPN servers is available in the app. What could be causing this behavior?

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: When started with autohotkey, the application doesn't load the configuration file  Topic is solved

Post by mikeyww » 16 Jan 2022, 15:39

You probably need to set the working directory. Aside from that, you could see whether the shortcut file has any command-line parameters. The second parameter of Run is the working directory.

Run, Target [, WorkingDir, Options, OutputVarPID]

The following might work if the program's directory should be the working directory.

Code: Select all

EnvGet, pf86, ProgramFiles(x86)
dir = %pf86%\Ivacy
Run, %dir%\Ivacy.exe, %dir%

Rostov
Posts: 129
Joined: 09 Apr 2020, 07:57

Re: When started with autohotkey, the application doesn't load the configuration file

Post by Rostov » 16 Jan 2022, 15:52

@mikeyww, yes, you were right. I had no idea that not setting the working directory could cause the configuration files to not be fully loaded. Thank you very much!

Post Reply

Return to “Ask for Help (v1)”