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:

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, references to 8.3 file names will inevitably accumulate in the registry.

Method 1: Stripping 8.3 file names during Windows setup

  1. Boot from a Windows DVD or USB stick to start the Windows setup and and let it copy the Windows files to your HDD/SSD:
  2. When the computer restarts for the first time, re-enter the setup program, just as before. When the language/keyboard dialog appears, press Shift+F10 to open a console. Use diskpart to determine the volume that Windows is being installed to. Here, D: is the relevant volume:
    X:\Sources>diskpart
    
    Microsoft DiskPart version 10.0.17763.1
    
    Copyright (C) Microsoft Corporation.
    On computer: MINWINPC
    
    DISKPART> list vol
    
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
      Volume 0     E   CCCOMA_X86F  UDF    CD-ROM      3461 MB  Healthy
      Volume 1     C   System Rese  NTFS   Partition    549 MB  Healthy
      Volume 2     D                NTFS   Partition     49 GB  Healthy
    
    DISKPART> exit
    
    Leaving DiskPart...
    
  3. Disable the creation of 8.3 file names on that volume:
    X:\Sources>fsutil 8dot3name set d: 1
    Successfully disabled 8dot3name generation on d:
  4. Strip the existing 8.3 file names:
    X:\Sources>fsutil 8dot3name strip /s /f d:\
    Scanning registry...
    
    Total affected registry keys:                   0
    
    Stripping 8dot3 names...
    
    Total files and directories scanned:        80517
    Total 8dot3 names found:                    47135
    Total 8dot3 names stripped:                 47135
    
    For details on the operations performed please see the log:
      "X:\windows\TEMP\8dot3_removal_log @(GMT 2019-02-01 01-50-41).log"
    
  5. Type exit to quit the console, then press Esc to restart your computer. The installation begun in step 1 will then continue.

Method 2: Stripping 8.3 file names from install.wim

Windows is installed with 8.3 file names exactly because the install.wim contains 8.3 file names. Therefore, if you strip all 8.3 file names from the install.wim, Windows will be installed without them.

  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 with Administrator privileges, 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.
    1. If you let the Setup program format your hard drive, no further action is required.
    2. If you want to re-use an existing volume without formatting it, you need to disable 8.3 file name generation manually. When the Where do you want to install Windows? dialog is shown, press Shift+F10, then type:
      fsutil 8dot3name set c: 1
      The command should respond with the message Successfully disabled 8dot3name generation on c:. Then type exit to continue the installation:

Conclusion

After Windows has been installed, 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 of fsutil is safe to use since the registry hive files contained in install.wim, such as \windows\system32\Config\SYSTEM or \Users\Default\NTUSER.DAT, do not reference any 8.3 file names.