Conditional Expression Test of @SFN

#1
Hi,
I am using;
Code:
TCC  16.02.48  Windows Vista [Version 6.0.6002]
TCC Build 48  Windows Vista Build 6002  Service Pack 2
When I do;
Code:
if exist "2014 01 06 1490.pdf" (echo Yes) else (echo No)
it returns;
Code:
Yes
which is correct.

When I do;
Code:
if exist %@sfn["2014 01 06 1490.pdf"] (echo Yes) else (echo No)
it returns;
Code:
No
which is not correct.

Am I missing something, or is this WAD?

Joe
 
May 12, 2014
18
0
Kansas
#2
FYI, this gives the same results. Looking at the v12 manual I don't see any warnings that IF doesn't work with short file names.
Code:
[M:\TCMD12x64]echo %@sfn["2014 01 06 1490.pdf"]
M:\TCMD12x64\201401~1.PDF

[M:\TCMD12x64]if exist 201401~1.PDF (echo Yes) else (echo No)
No

[M:\TCMD12x64]if isfile 201401~1.PDF (echo Yes) else (echo No)
No
However, it does work under CMD.EXE:
Code:
M:\TCMD12x64>if exist 201401~1.pdf echo Yes
Yes
 
Last edited: