mIRC Homepage
Posted By: STING [7.32] $shortfn doesn't work on Windows 8.1 - 11/04/14 06:29 PM

I've just noticed that $shortfn() doesn't work with me on Windows 8.1 (64-Bit). On Windows 7 it still works.

//echo -a $shortfn($mircexe)
The most common reason for this is that short filename creation may be disabled in Windows. You can find out more here. If it is disabled, or if is enabled but for some reason the file does not have a short filename set, Windows will return the long filename instead.
Thank you for the rapid response.

C:\WINDOWS\system32>fsutil 8dot3name query d:
The volume state is: 1 (8dot3 name creation is disabled).
The registry state is: 2 (Per volume setting - the default).

Based on the above two settings, 8dot3 name creation is disabled on d:

I guess using $shortfn() these days is really not a 'best practice' anymore and we should probably instead encapsulate paths with quotes. Right?
Posted By: Wims Re: [7.32] $shortfn doesn't work on Windows 8.1 - 11/04/14 07:21 PM
Not right, using $qt can fail if the path has consecutive spaces, while $shortfn works.
Ah, that's probably why I got rid of the quotes way back and switched to $shortfn() wink

So.. what then is the solution for file handling in a path with consecutive spaces wink
Posted By: Wims Re: [7.32] $shortfn doesn't work on Windows 8.1 - 11/04/14 08:02 PM
Only solution is $shortfn but it's so rare to have consecutives space in a filename that nobody ever complained, meaning nobody ever bothered using $shortfn anyway, $qt is much more used.
There is currently no general solution to handle leading/consecutives/trailing spaces with /commands.
© mIRC Discussion Forums