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 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

    Note that the /f parameter 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 contain a single reference to a 8.3 file name.
  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 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:
  7. 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.