Able to find directory with 8dot3 naming convention but not files

Page 1 of 2 12 LastLast
  1.    06 Feb 2018 #1

    Able to find directory with 8dot3 naming convention but not files

    I have a very strange problem - I have a script that's been running for years on other windows, using the 8dot3 convention. Both the directory and the file name have ~ in them. It finds the directory ok, but can't find the file, even though it exists. I've checked, and 8dot3 is enabled. Anyone else see this problem? Any ideas how to solve this? Or where I can go for help?
      My ComputerSystem Spec

  2.    06 Feb 2018 #2

    You can check short names for folders and files.

    Below command checks the short name for winaero.txt file. If no short name is present, blanks are displayed in its place.

    Dir  "E:\My_Notes\winaero.txt" /x

    To check if short names are disabled on a given volume, run the following as an administrator in a cmd prompt:

    fsutil 8dot3name query c:
    Enabling it is then just a case of running the following:

    fsutil 8dot3name set c: 0
    However, any file or folder created when short name creation was disabled will still have no short name since they are only created at initial file/folder creation, not on subsequent accesses to the file even if short name creation has subsequently been enabled.

    All is not lost as we can add short names for items that are missing them using the fsutil command again, for example:

    fsutil file setshortname "c:\program files" PROGRA~1
    fsutil file setshortname "c:\program files (x86)" PROGRA~2
    This approach can also be used to “repair” short names when they are incorrect.
      My ComputerSystem Spec

  3.    06 Feb 2018 #3

    I've checked and 8dot3name is set correctly.
    C:\Windows\system32>fsutil behavior query disable8dot3 c:
    The volume state is: 0 (8dot3 name creation is enabled).
    The registry state is: 2 (Per volume setting - the default).

    Based on the above two settings,8dot3 name creation is enabled on c:

    I can see the file when I do a dir /X, both short name and regular name, but I can't access the file using it's short name.
      My ComputerSystem Spec

  4.    06 Feb 2018 #4

    If it file has a short name and you can't access it then check to see if you are executing correct command for the file short name.

    Which command do you use to access
    files with short names?
      My ComputerSystem Spec

  5.    06 Feb 2018 #5

    It's a batch script so I just run it from the command line, but I can't even do a dir on the short filename. Thank you so much for responding.
      My ComputerSystem Spec

  6.    06 Feb 2018 #6

    I'm able to run the same on another windows 10 machine, just not on this one.
      My ComputerSystem Spec

  7.    06 Feb 2018 #7

    Execute below command to replace or add a new short name to a file/folder.

    fsutil file setshortname "c:\MyLongFileName.txt" MyLong~1
      My ComputerSystem Spec

  8.    06 Feb 2018 #8

    I can't change the file name or it's short name, this is being executed by automation unfortunately. I need to figure out why it's able to read directory names that are short names, but not file names
      My ComputerSystem Spec

  9.    06 Feb 2018 #9

    I'm sorry i could not found the way to only read directory names that are short names, but not file names. But i think you can use For command for this job. You use %~fsI modifier to expands %I to a full path name with short names only.
      My ComputerSystem Spec

  10.    06 Feb 2018 #10

    I want to be able to successfully do the following:
    dir C:\Users\xxx0523\AppData\Local\Temp\CCS_C1~1\util\7ZAEXE~1.BAT
    Even though 7ZAEXE~1.BAT exists, I'm unable to list it. I'm able to do dir C:\Users\xxx0523\AppData\Local\Temp\CCS_C1~1\util successfully. I think there's some setting that's missing on this machine, because I can do it successfully on another windows 10. Sigh!
      My ComputerSystem Spec

Page 1 of 2 12 LastLast

Related Threads
I'm running KODI on my XBOX and if I select an Artist, and click play, it plays all the track 1's of each album then all the track 2's etc. What I want is for it to play each album by track number. In the past I would edit the Track naming...
Hope this is the right place... searched and couldn't find answer. This is something I found really really useful in Windows 7: somehow I managed to add a particular directory (not "My Documents", just a directory I chose) to the places where the...
Heya For the life of me I can't find the Images Directory for the Photo screen saver in the registry to deploy via GPO. Any clues on where it hides in Win10? Thanks
Let me explain. I upgraded to windows 10 flawlessly. I want to change my .txt document to open with Notepad++ for coding. But every time I click properties>change Nothing pops up. Does anybody know a workaround or a fix? I need to get to work.:cry:...
25771 I just noticed some change in the Get Windows 10 app..
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 11:45.
Find Us