If .exe being ran by AHK crashes,

Get help with using AutoHotkey and its commands and hotkeys
airvent66
Posts: 2
Joined: 08 Aug 2020, 21:20

If .exe being ran by AHK crashes,

08 Aug 2020, 21:29

Hi all!

I am running a .exe program using AHK.

The .exe is being ran in a loop as below. Each time I am putting one of the files from my folder into the exe program.

Code: Select all

loop Files, % folder . "\*." . file_extension
{
Run, C:\Program Files (x86)\MMK2\M61K2.exe
.....
}
The problem that I am having (i think) is that sometimes the .exe program crashes and closes. When this happens it breaks my loop and my AHK scrip gets stuck waiting for a window to open that obviously never comes.

I would instead like to just continue with the next file in the folder when it crashes. But I can't figure out how to do this.

Any guidance would be much appreciated
Thankyou
hd0202
Posts: 163
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: If .exe being ran by AHK crashes,

09 Aug 2020, 01:40

hi, welcome !
I think it is not your .exe that crashes, its is AHK --> you run your .exe (and the following code ?) for all wanted files at the same time !
Therefore use

Code: Select all

RunWait, C:\Program Files (x86)\MMK2\M61K2.exe
to continue your processing when your .exe ends
Hubert
airvent66
Posts: 2
Joined: 08 Aug 2020, 21:20

Re: If .exe being ran by AHK crashes,

09 Aug 2020, 02:04

Thanks for the help Hubert. I'm actually trying to use AHK to interact with the exe's GUI so I dont think runwait is right for me? I could be wrong.
hd0202
Posts: 163
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: If .exe being ran by AHK crashes,

09 Aug 2020, 04:03

did you try RUNWAIT?
how does your exe get the filenames from the loop ?
how many "exe's GUI" are open when you run your script ?
Hubert

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], scriptor2016, songdg and 27 guests