Long file names first appeared in Windows 95, more than 30 years ago. Despite this, Windows 10 and Windows 11 are still installed with 8.3 file names enabled by default. For example, after a clean install of Windows 11 Pro, there are more than 80,000 8.3 file names present on C:\, including the notorious PROGRA~1:
Microsoft Windows [Version 10.0.26100.1150]
(c) Microsoft Corporation. All rights reserved.
C:\>dir c:\ /a /x
Volume in drive C is Windows
Volume Serial Number is 3EF6-4338
Directory of c:\
2024-09-14 12:20 <DIR> $Recycle.Bin
2024-09-14 12:17 <JUNCTION> Documents and Settings [C:\Users]
2024-04-01 09:26 <DIR> PerfLogs
2024-09-14 12:19 <DIR> PROGRA~1 Program Files
2024-09-14 21:16 <DIR> PROGRA~2 Program Files (x86)
2024-09-14 12:19 <DIR> PROGRA~3 ProgramData
2024-09-14 12:17 <DIR> Recovery
2024-09-14 12:17 <DIR> SYSTEM~1 System Volume Information
2024-09-14 12:20 <DIR> Users
2024-09-14 12:19 <DIR> Windows
2024-09-14 12:18 12.288 DUMPST~1.TMP DumpStack.log.tmp
2024-09-14 12:18 1.207.959.552 pagefile.sys
2024-09-14 12:18 16.777.216 swapfile.sys
3 File(s) 1.224.749.056 bytes
11 Dir(s) 44.849.307.648 bytes free8.3 file names cause several problems:
dir *1 or PowerShell's
Get-ChildItem -Filter *1 will return false positive results when the 8.3 file name matches the pattern.
While %windir%\system32\fsutil.exe 8dot3name strip can be used to strip existing 8.3 file names from a volume at any time, it is preferable to turn off 8.3 file name creation as early as possible. Otherwise, 8.3 file names will inevitably accumulate in the registry. Also, when you run fsutil.exe on a live system, many files could not be processed because they would be in use. Therefore, it is best to strip 8.3 file names before Windows has even started for the first time, i.e. in the PE stage of Windows Setup.
Using my autounattend.xml generator, you can strip 8.3 file names automatically during the PE stage of Windows Setup. To do so, just select the checkbox. After Windows has been installed, make sure that dir c:\ /a /x does not show any 8.3 file names and that %windir%\system32\fsutil.exe 8dot3name query c: reports no 8.3 file names are generated.
It is worth mentioning that Windows Setup does not actually create 8.3 file names. Instead, the Windows 10 and Windows 11 WIM images already contain 8.3 file names. This can be demonstrated e.g. using 7-Zip:
C:\>"%ProgramFiles%\7-Zip\7z.exe" l -slt "…\install.wim" | findstr.exe /r /c:"^Short Name = [A-Z]"
Short Name = PROGRA~1
Short Name = PROGRA~2
Short Name = COMMON~1
Short Name = INTERN~1
Short Name = WINDOW~1
Short Name = WINDOW~2
Short Name = WI54FB~1
Short Name = WI7A8C~1
…