Thanks for reporting back. I have updated the installer (for the next release) to set the working directory to the directory which contains the script. It was defaulting to whatever working directory explorer.exe had (probably System32).
I considered retrieving the working directory of the script and restarting it with that, but it would be more complicated. It is also possible that the script expects to start in a different working directory to what it is using at the moment the installer closes it. We can't just send a reload message to the script, because it's not running
and a standard reload wouldn't work anyway because the new window title is different (if the AutoHotkey version changed).
It is generally recommended to SetWorkingDir in your script's auto-execute section. For instance, the default "New AutoHotkey Script" template contains the following line:
Code: Select all
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
AutoHotkey v2-alpha sets the working directory to A_ScriptDir by default.