8.3 filename short and windows 11

Microsoft Windows
Post Reply
daviaujp
Posts: 6
Joined: 2023-Nov-26, 2:46 am

8.3 filename short and windows 11

Post by daviaujp »

Hi,

Ref:
"NtfsDisable8dot3NameCreation"=dword:00000002
"Win31FileSystem"=dword:00000000

Code: Select all


::tst.cmd averylongfilename.txt
::
echo short filename=  %~sn1
echo short filename=  %~sf1
echo short file extension=  %~sx1
short filename= averylongfilename
short filename= C:\Users\PC\Desktop\CMDtest\averylongfilename.txt
short file extension= .txt


Does not work.

JPDaviau
User avatar
Simon Sheppard
Posts: 191
Joined: 2021-Jul-10, 7:46 pm
Contact:

Re: 8.3 filename short and windows 11

Post by Simon Sheppard »

These are the values for NtfsDisable8dot3NameCreation

0 NTFS creates short file names. This setting enables applications that cannot process long file names and computers that use differentcode pages to find the files.

1 NTFS does not create short file names. Although this setting increases file performance, applications that cannot process long file names, and computers that use different code pages, might not be able to find the files.

2 NTFS sets the 8.3 naming convention creation on a per volume basis.

3 NTFS disables 8dot3 name creation on all volumes except the system volume.

So try setting it to 1 or 3 to disable short names.

I don't think you need to touch Win31FileSystem at all, that would disable LONG filenames if set to true, but I'm doubtful that recent OS's will pay any attention to it.

or use FSUTIL 8dot3name if you do want to set it for one volume only.
Post Reply