Installing Windows 10 without 8.3 file names

Long file names first appeared in Windows 95, more than 20 years ago. Despite this, even Windows 10 is still installed with 8.3 file names enabled by default. For example, after a clean install of Windows 10 Home, there are almost 50,000 8.3 file names present on C:\, including the notorious PROGRA~1:

Microsoft Windows [Version 10.0.17763.1]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\>dir c:\ /x
 Volume in drive C has no label.
 Volume Serial Number is D290-2E67

 Directory of C:\

15/09/2018  06:08                24              autoexec.bat
15/09/2018  06:08                10              config.sys
15/09/2018  06:10    <DIR>                       PerfLogs
09/11/2018  00:35    <DIR>          PROGRA~1     Program Files
09/11/2018  00:37    <DIR>                       Users
08/11/2018  16:52    <DIR>                       Windows
               2 File(s)             34 bytes
               4 Dir(s)  45.187.481.600 bytes free

8.3 file names cause several problems:

%windir%\system32\fsutil.exe 8dot3name strip can be used to strip existing 8.3 file names from a volume. However, it would be preferable to install Windows 10 without creating 8.3 file names in the first place. To achieve this, 8.3 file names must be stripped from the install.wim used to install Windows.

  1. Download a Windows 10 ISO image.
  2. Extract the ISO image.
  3. Locate the install.wim file in the sources subfolder.
  4. Run this PowerShell script, after changing the $WimFile and $Edition variables if necessary:
    $WimFile = 'C:\iso\sources\install.wim';
    
    $Edition = 'Windows 10 Home';
    # $Edition = 'Windows 10 Home N';
    # $Edition = 'Windows 10 Home Single Language';
    # $Edition = 'Windows 10 Education';
    # $Edition = 'Windows 10 Education N';
    # $Edition = 'Windows 10 Pro';
    # $Edition = 'Windows 10 Pro N';
    # $Edition = 'Windows 10 Pro Education';
    # $Edition = 'Windows 10 Pro Education N';
    # $Edition = 'Windows 10 Pro for Workstations';
    # $Edition = 'Windows 10 Pro N for Workstations';
    
    $MountDirectory = "$env:TEMP\{0}" -f [System.Guid]::NewGuid();
    mkdir $MountDirectory | Out-Null;
    "WIM image will be mounted to '$MountDirectory'.";
    Mount-WindowsImage -Path $MountDirectory -ImagePath $WimFile -Name $Edition;
    
    & "$env:windir\system32\fsutil.exe" 8dot3name strip /f /s $MountDirectory;
    
    Dismount-WindowsImage -Path $MountDirectory -Save;
    rmdir $MountDirectory -Force;
    

    Download wim-strip-8.3.ps1

  5. Copy the extracted ISO image (which now includes the modified install.wim) to a bootable USB stick, or use software such as ImgBurn to create a bootable DVD or a bootable ISO image.
  6. Install Windows as usual.
  7. Make sure that dir /x does not show any 8.3 file names and that %windir%\system32\fsutil.exe 8dot3name query c: reports 8.3 file name are not generated.

Note that the /f parameter is safe to use since the registry hive files contained inside install.wim do not contain a single 8.3 file name.