jeeswg wrote:That's interesting. I knocked up some quick RegEx:
...
Interesting, can I use your RegEx brain for a minute (or two)? What would be the RegEx expresion used with RegExMatch that would return true for the following paths and false for any other path?
\\127.0.0.1
\\127.0.0.1\
\\MyDomain
\\MyDomain\
This would help me make a workaround. Not checking if file (folder) exists when it is an UNC root would be sufficient for my need.
jeeswg wrote:Can you use this?
Code: Select all
MsgBox, % FileExist("\\127.0.0.1\*")
Unfortunately, it returns the same result. Same for "\\127.0.0.1\*." or "\\127.0.0.1\*.*".
obeeb wrote:Cant argue with that ;). I guess the people who made it this way thought it won't be logical to treat a network share as a file.
Not a file I agree, but it could be treated as a folder...
obeeb wrote:After checking Autohotkey source code it actually uses
GetFileAttributes.
GetFileAttributes wrote:If you call GetFileAttributes for a network share, the function fails, and GetLastError returns ERROR_BAD_NETPATH. You must specify a path to a subfolder on that share.
Wouldn't it be possible to retrieve this error in AHK after FileExist? A_ErrorLevel is useless actually.