Can't open AHK file Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
hieveryone
Posts: 43
Joined: 28 Nov 2022, 01:31

Can't open AHK file

11 Nov 2023, 07:07

Hello, I have encountered something
Not sure if I should put this as a bug or ask for help, but.

Ive been getting a message when im trying to open a file in AHK,
"Error: (2) The system cannot find the file specified."
and always gives me this message: "▶ 250: proc := RunWithHandles(cmd, {in: hStdIn, out: hStdOut, err: hStdErr})"

I am unsure why it does this, but keep in mind:
-the code still exists
-it gives an error on all of my files except for one AHK file that I have made, meaning it does not give the error on all.

My theory is that it is a version problem, or antivirus , but if there are any better conclusions please respond.
User avatar
Ragnar
Posts: 627
Joined: 30 Sep 2013, 15:25

Re: Can't open AHK file

13 Nov 2023, 03:21

You are not currently being helped because you are not providing enough useful information. For example, you could post the code (shortened to the essentials) so that others can reproduce your problem. RunWithHandles() is especially interesting to know what it does.
hieveryone
Posts: 43
Joined: 28 Nov 2022, 01:31

Re: Can't open AHK file

14 Nov 2023, 07:12

Ragnar wrote:
13 Nov 2023, 03:21
You are not currently being helped because you are not providing enough useful information. For example, you could post the code (shortened to the essentials) so that others can reproduce your problem. RunWithHandles() is especially interesting to know what it does.
Hello thanks for reaching out.

I just wanted to know if anyone else encountered this problem, because it is not one specific code.
Nearly 99%of my scripts came out like this but they all used to work. and now none of them do

If you know any solution, it will be appreciated
hieveryone
Posts: 43
Joined: 28 Nov 2022, 01:31

Re: Can't open AHK file

14 Nov 2023, 07:16

@Ragnar
maybe, just in short,
would it be helpful to broaden what is happeing?
Basically,
in short, when I open a file, it comes up with an error and can not run the file. It has nothing to do with the code itself.
Do you know any reasons why this might be happening?

Thanks in advance
User avatar
Ragnar
Posts: 627
Joined: 30 Sep 2013, 15:25

Re: Can't open AHK file  Topic is solved

14 Nov 2023, 09:23

It may be due to running without admin rights or network drive related issues. Hard to say, anything is possible. You might want to search the error message on the internet for possible solutions, optionally with "autohotkey" as an additional search term.
hieveryone
Posts: 43
Joined: 28 Nov 2022, 01:31

Re: Can't open AHK file

08 Dec 2023, 22:18

@Ragnar
thanks ill try
hieveryone
Posts: 43
Joined: 28 Nov 2022, 01:31

Re: Can't open AHK file

08 Dec 2023, 22:29

@Ragnar
ok edit, i fixed it.
It has nothing to do with anything apart from that I have to download AHK again
which is strange I'm not sure why.
rotamotua
Posts: 18
Joined: 20 Nov 2023, 14:19

Re: Can't open AHK file

11 Dec 2023, 02:20

@hieveryone
How are you trying to open the ahk file ? Simply double clicking or with other method?

Lets give a try with fresh copy of portable download.
Download ZIP AHK form : https://www.autohotkey.com/download/
Download both V1 and V2 zips. (Not installer).

just extract the the Executables (you do not need other files):
V1 : AutoHotKeyA32.exe, AutoHotKeyU32.exe, AutoHotKeyU64.exe
V2 : AutoHotKey32.exe, AutoHotKey64.exe

to one folder.
Each executable is capable of running the .ahk files (of correct versions).

Now, either you drag and drop your ahk files over these executables , or you copy the file and paste (the file, not content) in one of these executables. You should be able to see the result.


Worst Case Situation :
You might have to unblock the executable.

How ?
Select File and ALT + Enter OR
Right click the executable (one file at a time) >> Properties >> General Tab and check the Unblock checkbox.
(not sure if it elevates UAC.)

Even after unblocking if you got same error, I would doubt the header information on your ahk file . To save myself, i would select first few words, and delete EVERYTHING BEFORE that even the empty spaces, or lines. retype the deleted words and save it. Try running with with same copy-paste / or drag drop method.

If it does not run, then you might have to check the hash of your exe files, with that of ahk on git (to make sure your executable is not compromised on your system), or have a deep dig into your OS.

hopefully it solves your problem.
lexikos
Posts: 9665
Joined: 30 Sep 2013, 04:07
Contact:

Re: Can't open AHK file

17 Dec 2023, 03:51

RunWithHandles is a function in the AutoHotkey Launcher. My guess would be that one of the AutoHotkey interpreter files was deleted (such as by an antivirus). The launcher code probably doesn't account for files in installedfiles.csv (created by the installer) having been externally deleted.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: No registered users and 45 guests