mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 122
S
STING Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Dec 2002
Posts: 122
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)

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.

Joined: Dec 2002
Posts: 122
S
STING Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Dec 2002
Posts: 122
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?

Last edited by STING; 11/04/14 07:12 PM.
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Not right, using $qt can fail if the path has consecutive spaces, while $shortfn works.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 122
S
STING Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Dec 2002
Posts: 122
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

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard