GithubHelp home page GithubHelp logo

Comments (12)

lostmsu avatar lostmsu commented on May 25, 2024

I found a workaround for this issue: you can use GetShortPathName function to generate a DOS-compatible name, and that name will work.

from detours.

sp00n avatar sp00n commented on May 25, 2024

I found a workaround for this issue: you can use GetShortPathName function to generate a DOS-compatible name, and that name will work.

If I remember correctly, I did try that during my tests, and while it worked for some directories, some still threw an error.

from detours.

lostmsu avatar lostmsu commented on May 25, 2024

@sp00n if I'd be guessing I'd say it would not work for relative paths, but should have worked for absolute ones.

from detours.

LeoDavidson avatar LeoDavidson commented on May 25, 2024

Short names are not always turned on in the filesystem with Windows these days.

They can be useful as one possible workaround, but they won't always be available. It depends how the filesystem was formatted. Maintaining the short names, and testing for two names instead of one each time, slows down filesystem operations slightly, which I think is the main reason they aren't on all the time. That and not much software requires them anymore.

The default for Windows seems to have changed back and forth a few times in recent years, in my experience, but maybe there's more to it (e.g. Home vs Pro versions could be a factor). I don't know the exact rules for when they're on by default, as they seem to change, but people can also override that and turn them on or off if they wish. So you cannot depend on 8.3 names existing these days.

from detours.

lostmsu avatar lostmsu commented on May 25, 2024

@LeoDavidson AFAIK by default they are on on NTFS and AFAIK ReFS can not be booted from. I can't imagine even 0.1% of all Windows users turning them off, so it should be a fine workaround. And the 0.1% users can turn them back on if they really need my software.

But this is still just a workaround. A proper fix should be implemented eventually one way or another.

from detours.

LeoDavidson avatar LeoDavidson commented on May 25, 2024

They are not always on by default these days, and also not always on for every drive in a system either. That's the problem.

This SuperUser post has an answer saying Windows 8 and Server 2012 turned short names off by default, which fits with my memory of when it changed:

https://superuser.com/questions/1505174/how-comes-that-short-filenames-8-3-are-created-in-one-partition-and-not-in-ano

It's possible Microsoft reversed the decision again in later OS but I'm not sure. You can't depend on them being there in any case.

from detours.

sp00n avatar sp00n commented on May 25, 2024

Ah, I think it was disabled by default on my NVMe drives, which is why I quickly abandoned it.

// Edit
My HKLM\System\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation setting is set to 2, which according to the SuperUser link above means it "Sets 8dot3 name creation on a per volume basis".
And using the fsutil 8dot3name query DRIVELETTER: command revealed that only some of my drives/partitions have it enabled, for no apparent reason (that I can think of).
The SATA SSD boot drive has it enabled, two of my SATA HDDs don't, but the third one does, for the NVMe it's disabled, as well as for two attached USB drives. 🤷‍♂️

from detours.

lostmsu avatar lostmsu commented on May 25, 2024

@sp00n AFAIK off on ReFS

from detours.

sp00n avatar sp00n commented on May 25, 2024

@sp00n AFAIK off on ReFS

All my partitions are in NTFS though.

from detours.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.