1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Problem with @SFN (short filenames)

Discussion in 'Support' started by mikea, Aug 14, 2016.

  1. mikea

    Joined:
    Dec 7, 2009
    Messages:
    210
    Likes Received:
    2
    A search didn't quickly turn up a topic like this...

    I was using a semi-ancient version of TCC and am now using:

    TCC 20.00.14 x64 Windows 10 [Version 6.3.14393]
    TCC Build 14 Windows 10 Build 14393


    I don't recall having had problems with
    %@sfn[] in the past, but I'm seeing some now. Example:

    c:\> echo %@sfn["Program Files"]
    (result:) C:\PROGRA~1 (expected)

    c:\> echo %@sfn[%programfiles]
    (result:) C:\PROGRA~1

    I made a "Program Files" directory on D: as well.

    d:\> echo %@sfn["Program Files"]
    (result:) D:\Program Files (unexpected)

    c:\> set zorch=D:\Program Files
    c:\> echo %@sfn[%zorch]
    (result:) D:\Program Files

    Now change the "D:" to "C:" in the variable:


    d:\> set zorch=C:\Program Files

    Now . . .
    d:\> echo %@sfn[%zorch]
    (result:) C:\PROGRA~1

    So the @SFN function doesn't seem to work at all with file or directory names on this laptop's D: drive. I noticed this when I upgraded from the semi-ancient TCC version to v.19 and noticed it again on installing v.20 today.

    I don't recall that sort of thing being a problem in the past. Is it WAD? If so, what's the basis for the difference? And if so, is there some other way to return short filenames on D: without having to resort to using a cmd.exe-style "for" loop? (UGH)

    I also notice that whereas Control+A toggles between SFNs and LFNs on drive C:, it doesn't work on drive D.
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,885
    Likes Received:
    29
    Are both drives NTFS? It is possible (but I never heard of it being done) to disable 8dot3 name creation on NTFS drive by drive. Try this (elevated) for c: and d:.
    Code:
    v:\> fsutil 8dot3name query c:
    The volume state for Disable8dot3 is 0 (8dot3 name creation is enabled).
    The registry state of NtfsDisable8dot3NameCreation is 1 (Disable 8dot3 name creation on all volumes).
    Based on the above two settings, 8dot3 name creation is disabled on c:.
     
  3. mikea

    Joined:
    Dec 7, 2009
    Messages:
    210
    Likes Received:
    2

    Well by Godfrey you've nailed it. Thanks very much for this suggestion. Both drives are NTFS. The output of your suggested command:

    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 did a web search for more information about this — it's harder to find than I'd expected — and turned up:

    fsutil.exe behavior set disable8dot3 0

    Does that look like the right command? Is it a setting that "sticks" once you've disabled the disabling? (as it were)

    Then I should ask Lenovo what's the deal with having it the one way on the one drive and not on the other.

    Thanks again!
     
  4. mikea

    Joined:
    Dec 7, 2009
    Messages:
    210
    Likes Received:
    2
    FSUTIL must be an ancient tool. It has the same wretched online "help" display of other ancient MS command-line tools. Lazy SOBs...
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,885
    Likes Received:
    29
    I don't know about that command. If there's a specific "disabled" registry entry for d:, that may override it. Experiment ... of keep Googling. :-)
     
  6. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    659
    Likes Received:
    8
    Much better help...

    FSUtil - File system utilities

    Joe
     
  7. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,808
    Likes Received:
    82
    And make sure you have SFN support enabled in "OPTION / Startup / Search for SFNs". It is disabled by default (because SFNs have been deprecated for at least 15 years!)
     

Share This Page