mIRC Homepage

[7.32] $shortfn doesn't work on Windows 8.1

Posted By: STING

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

Hello,

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)
Posted By: Khaled

Re: [7.32] $shortfn doesn't work on Windows 8.1 - 11/04/14 07:00 PM

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.
Posted By: STING

Re: [7.32] $shortfn doesn't work on Windows 8.1 - 11/04/14 07:11 PM

Thank you for the rapid response.

Code:
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.
Posted By: STING

Re: [7.32] $shortfn doesn't work on Windows 8.1 - 11/04/14 07:28 PM

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.
© 2021 mIRC Discussion Forums