Hi,
I'm using Ahk2Exe regularly but today it fail compiling me script, returning the error: "Error: Error opening the destination file."
I'm using the compiler in command-line mode. I'm creating the exe file on a DropBox folder but had the same error when trying on another drive. There is no disk space issue.
Any idea what could cause this error?
Thanks.
Ahk2Exe unable to create destination file
Ahk2Exe unable to create destination file
Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Re: Ahk2Exe unable to create destination file
I often get problems with file operations (in generals) on dropbox folders, try to pause syncing or use another folder.
Cheers.
Cheers.
Re: Ahk2Exe unable to create destination file
This error can occur if your antivirus software decides to check the output file while it is being finalised. Also see a similar post here.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Ahk2Exe unable to create destination file
HI Helgef,
Thanks for the reply. I tried these 2 solutions with the same result.
But I just tried disabling Windows Defender real-time protection and then it worked. So this seems to be a conflict with Windows Defender.
I'd prefer to find a solution in order to be able to compile without having to turn the protection off... Since I'm compiling using a batch file, maybe there is a command line to disable Windows Defender before compiling and re-enable it after... but this is not the forum for this question ;-)
Thanks for the reply. I tried these 2 solutions with the same result.
But I just tried disabling Windows Defender real-time protection and then it worked. So this seems to be a conflict with Windows Defender.
I'd prefer to find a solution in order to be able to compile without having to turn the protection off... Since I'm compiling using a batch file, maybe there is a command line to disable Windows Defender before compiling and re-enable it after... but this is not the forum for this question ;-)
Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Re: Ahk2Exe unable to create destination file
I don’t believe Dropbox will have a bearing on this problem, as the generated file is in the user's %temp% directory at this stage of the compilation process.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Ahk2Exe unable to create destination file
Our messages crossed. I was testing it with Windows Defender instead of reading your reply :-)
So, to continue on my previous message, I added a folder exception to the Windows Defender config so I should be OK now.
And thanks TAC109 for the link to the other thread. I should have search better before.
Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Re: Ahk2Exe unable to create destination file
Cheers!
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Ahk2Exe unable to create destination file
@JnLlnd
I've published a new version of Ahk2Exe, Beta_9a, that allow a retry in this situation. Would you like to see if it helps?
I've published a new version of Ahk2Exe, Beta_9a, that allow a retry in this situation. Would you like to see if it helps?
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Ahk2Exe unable to create destination file
Thanks for doing this. I tested your compiled version with a sample script saved on my Dropbox with Defender enabled and it worked.
However, I must say that the issue I reported yesterday was with an older version of the Ahk2Exe-edge compiler customized for my development pipeline. So, I could not confirm that the new version would work as a replacement of my old version in my custom environment. When I find time to tweak your new version, I'll follow-up here.
Thanks again.
Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Re: Ahk2Exe unable to create destination file
Ahh... If you’re using an older Ahk2Exe-edge version created by fincs, it won’t using your %temp% directory for generating the .exe. In your case Ahk2Exe will be using the Dropbox folder as you indicated before. (This use of %temp% was one of the changes I migrated from Ahk2Exe-master back when I started work on the new version.)
I too, used to get similar errors when I compiled into a Dropbox folder, so the problem may not have been anti-virus related.
Cheers
I too, used to get similar errors when I compiled into a Dropbox folder, so the problem may not have been anti-virus related.
Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Ahk2Exe unable to create destination file
@JnLlnd
Further to my last reply, here is a little script I used to use to run the old Ahk2Exe-edge by fincs. You might find it useful to avoid Dropbox problems. It also provides for new versions of Autohotkey, and new versions of this script.
I had the edge compiler installed in the standard C:\Program Files\AutoHotkey\Compiler\ as Ahk2Exe1.exe.
I had this script called Ahk2Exe.ahk in my source folder.
If I had a new version of this script I would compile it with default parameters so the compiled version was in the source folder. Then I ran the source Ahk2Exe.ahk, which copied Ahk2Exe.exe from the source folder to C:\Program Files\AutoHotkey\Compiler\.
After installing a new version of AutoHotkey, I would again run the source Ahk2Exe.ahk (without compiling first). This would re-set my compiled script to be the official Ahk2Exe.exe
After that, all compiles could proceed normally. All compiles of other scripts could be started by running C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe in any of the standard usual ways.
(Please excuse the quality of the program code! it was early days for me with Ahk.)
You wil see that the compiled script monitors for the error, and restarts the compile if it occurs.
Further to my last reply, here is a little script I used to use to run the old Ahk2Exe-edge by fincs. You might find it useful to avoid Dropbox problems. It also provides for new versions of Autohotkey, and new versions of this script.
I had the edge compiler installed in the standard C:\Program Files\AutoHotkey\Compiler\ as Ahk2Exe1.exe.
I had this script called Ahk2Exe.ahk in my source folder.
If I had a new version of this script I would compile it with default parameters so the compiled version was in the source folder. Then I ran the source Ahk2Exe.ahk, which copied Ahk2Exe.exe from the source folder to C:\Program Files\AutoHotkey\Compiler\.
After installing a new version of AutoHotkey, I would again run the source Ahk2Exe.ahk (without compiling first). This would re-set my compiled script to be the official Ahk2Exe.exe
After that, all compiles could proceed normally. All compiles of other scripts could be started by running C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe in any of the standard usual ways.
(Please excuse the quality of the program code! it was early days for me with Ahk.)
Code: Select all
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory
pf:="c:\Program Files\AutoHotkey\Compiler\"
if !A_IsCompiled
{ IfEqual 0, 0, IfEqual A_IsAdmin, 0, run *RunAs %A_ScriptFullPath%
IfEqual 0, 0, IfEqual A_IsAdmin, 0, ExitApp
IfEqual 0, 0, IfExist Ahk2Exe.exe, FileMove Ahk2Exe.exe,%pf%Ahk2Exe.exe.copy,1
IfEqual 0, 0, FileCopy %pf%Ahk2Exe.exe.copy, %pf%Ahk2Exe.exe, 1
IfEqual 0, 0, MsgBox 64,, Ahk2Exe has been set up, result=%ErrorLevel%
IfEqual 0, 0, ExitApp
}
Loop
{ run %pf%Ahk2Exe1.exe %1% "%2%"
Loop
{ Sleep 500
IfWinActive Ahk2Exe Error, Error: Error opening the destination file.
{ send {Enter}
WinWaitClose ahk_exe Ahk2Exe1.exe
continue 2
}
Process Exist, Ahk2Exe1.exe
IfEqual ErrorLevel, 0, break 2
} }
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Ahk2Exe unable to create destination file
Thanks, TAC109. I'll check it.
Jean
Jean
Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Who is online
Users browsing this forum: Bing [Bot], DataLife, ShatterCoder and 196 guests