@ALTNAME[filename] :  Returns the alternate (short, "8.3" FAT-format) name for the specified file. If the filename is already in 8.3 format, returns the filename. If the file does not exist, returns an empty string. If filename contains a \, @ALTNAME returns the SFN of the full path.

 

Examples:

 

echo %@altname["Long Name.exe"]

LONGNA~1.EXE

 

echo %@altname["C:\Program Files\Microsoft Office"]

C:\PROGRA~1\MICROS~4

 

echo %@altname["%CommonProgramFiles"]

C:\PROGRA~1\COMMON~1