Code: Select all
@echo off
"Z Bug 2.ahk"
:: "C:\Program Files\AutoHotkey\AutoHotkeyU32.exe" "Z bug 2.ahk"
echo %errorlevel%
pause
Code: Select all
MsgBox
ExitApp 10
Run the Z Bug 2.cmd file as is, in a system where the UX launcher is installed. It will be observed that Z Bug 2.cmd terminates before Z Bug 2.ahk with an errorlevel of 0.
If, in the .cmd file, the second line is commented out and the third line is uncommented so that the launcher is not involved, the Z Bug 2.cmd file waits as expected until the Z Bug 2.ahk has terminated, and shows the correct errorlevel.
A similar problem occurs when a script RunWaits another script and involves the launcher.
Cheers