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:

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 an installation media (Windows DVD, USB stick, PXE) and press Shift+F10 to open a command prompt as soon as you see the language and keyboard selection dialog. Then run the command setup.exe /noreboot and proceed as usual. Windows setup copies the files onto the selected partition and installs the boot manager, but does not reboot the computer.
  2. When the command prompt shows again, use diskpart to determine the volume that Windows is being installed to. Here, D: is the relevant volume:
  3. Disable the creation of 8.3 file names on that volume:
  4. Remove all already created 8.3 file names:
  5. Finally run the command wpeutil.exe reboot to reboot the computer and start the second phase of Windows setup.

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 setting the $WimFile variable accordingly:
    This script will run for serveral minutes as it mounts the editions contained in install.wim (such as Windows 10 Home or Windows 10 Education) one after another.
  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:
      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 c:\ /a /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.