Page 1 of 1

BUG: error code compilng from network path

Posted: 12 May 2021, 06:33
by Tomer
Hey,

The following error started appearing from the version "1.1.33.02 - July 17, 2020" or maybe earlier

when compilng a script from a network path uses #include,
(sample of network path: \\servername\shardfolder)

then the following error code showing up (see attachment img)

what i do to solve this ?

i copy the files to a local drive and then i make the compile,
its works but its very annoying since all my scripts located in the network

* or i use version 1.1.32.00 - November 24, 2019,
in this ver, i can compile my scripts from a network path as well

Please fix it:)

Thanks in advance

Re: BUG: error code compilng from network path

Posted: 13 May 2021, 01:23
by TAC109
@lexikos This error is being returned from AutoHotkey when called with the /ilib parameter from Ahk2Exe.

Re: BUG: error code compilng from network path

Posted: 18 May 2021, 00:04
by Tomer
Any Reference :?:

Re: BUG: error code compilng from network path

Posted: 19 May 2021, 04:05
by lexikos
AutoHotkey.exe can't find the file because it doesn't exist in the working directory. Ahk2Exe uses cmd.exe to redirect the output to a text file, and cmd.exe does not support UNC paths for the working directory.

This can be solved by using some other method of capturing stdout/stderr. WScript.Shell is the easiest/shortest way, but it doesn't support Unicode. For that we can call CreateProcess and pass it stdin/stderr handles of our own. There are a few versions of "StdOutToVar" and some other scripts that do this.

Users can work around it by using mapped network drives (i.e. use a drive letter mapped to a network location instead of the direct UNC path).

This shouldn't be an issue with AutoHotkey v2 because #include is relative to the current file's directory by default, not the original working directory.

Re: BUG: error code compilng from network path

Posted: 19 May 2021, 05:02
by Tomer
Thanks for reply!

any chance a fix will be included it in upcoming AHK versions ?

for now im using version 1.1.32.00 to compile scripts from UNC paths,
but i may update to latest version and use your suggestion using mapped network drivers only If there is no future planning fix it..

Re: BUG: error code compilng from network path  Topic is solved

Posted: 29 Jul 2021, 21:57
by TAC109
@Tomer
I've attached a zipped beta version of Ahk2Exe that should allow you to compile scripts from a UNC path. You will need to unblock the zip file before extracting Ahk2Exe.exe. Copy this to your AutoHotkey\Compiler directory and run from there.

Cheers