BUG: error code compilng from network path

Report problems with documented functionality
User avatar
Tomer
Posts: 340
Joined: 21 Aug 2016, 05:11

BUG: error code compilng from network path

Post by Tomer » 12 May 2021, 06:33

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
Attachments
123.png
123.png (22.61 KiB) Viewed 205 times
Last edited by Tomer on 14 May 2021, 05:17, edited 1 time in total.

TAC109
Posts: 690
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: BUG: error code compilng from network path

Post by TAC109 » 13 May 2021, 01:23

@lexikos This error is being returned from AutoHotkey when called with the /ilib parameter from Ahk2Exe.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility

User avatar
Tomer
Posts: 340
Joined: 21 Aug 2016, 05:11

Re: BUG: error code compilng from network path

Post by Tomer » 18 May 2021, 00:04

Any Reference :?:

lexikos
Posts: 7511
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: BUG: error code compilng from network path

Post by lexikos » 19 May 2021, 04:05

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.

User avatar
Tomer
Posts: 340
Joined: 21 Aug 2016, 05:11

Re: BUG: error code compilng from network path

Post by Tomer » 19 May 2021, 05:02

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..

Post Reply

Return to “Bug Reports”