Why doesn't @altname with a variable work? - TCC

35 Views Asked by At

This is a TCC code.

I wanted my .BAT file to return a shortened name for a specified file (with @ALTNAME), but I don't want it to return the whole path of the file. My solution doesn't seem to be working. Can someone tell me what am I doing wrong?

I used the function @FILENAME and added it to a variable. Then, I used @ALTNAME with the variable. Is this not allowed?

Edit: It works when I use %1 instead of FNAME, but it returns the whole path to the file as well, which is not what I'm looking for.

set FNAME=%@filename[%1]
set ANAME=%@altname[FNAME]

echo Name of the file:
echo %FNAME
echo.


echo Shortened name of the file:
echo %ANAME
echo.
0

There are 0 best solutions below