I have Z: substituted to a network drive, eg:
subst Z: \\fc\c
xfile is a file (not a directory!) that exists in the root of the substituted drive. The below statement incorrectly echoes -exists-
if exist z:\xfile\nul echo -exists-
This makes xfile appear to be a directory, when it's really a file.
A non-substituted drive letter does not cause the problem. A subst to a non-network drive also does not cause the problem.
Is there a workaround to handle what looks like a subst or if-exist bug?
Here is a general construct which should work from your .BAT file argument, (this one assumes it is the first argument
%1
):