Short file names

#1
I know I should know this, but, well...

If I have a path to a file or folder

C:\Users\CWBillow\Documents\~ System\~ miTaggedMarks\Backup\miTaggedMarks.ini

How can I convert that to the 8.3 format-- not change it, just view what it would be?

Regards,
Chuck Billow
 
#2
Look up @sfn and @altname in the online help. One of those should do what you want.

Also, when you look them up you should see a help item called Functions by Category. Click that, and one of the categories on the page is File names. Underneath there are a number of links to filename-related variable function topics.
 
#3
Now I AM feeling stupid. I tried using @sfn from the command-line and keep getting errors. For instance, I typed at the command-line

@sfn "C:\Users\CWBillow\Documents\~ System\~ miTaggedMarks\Backup\miTaggedMarks.ini"

Didn't work. OK, it's all wromng...why?

Chuck
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,725
47
Albuquerque, NM
prospero.unm.edu
#5
Now I AM feeling stupid. I tried using @sfn from the command-line and keep getting errors. For instance, I typed at the command-line

@sfn "C:\Users\CWBillow\Documents\~ System\~ miTaggedMarks\Backup\miTaggedMarks.ini"

Didn't work. OK, it's all wromng...why?
It's a function, not a command. You would use it as the argument to any command -- ECHO, for example:
Code:
echo %@sfn["C:\Users\CWBillow\Documents\~ System\~ miTaggedMarks\Backup\miTaggedMarks.ini"]
If you find yourself doing this often, you can create your own command with an alias:
Code:
alias sfn=`echo %@sfn[%1]`