Issue

With the Microsoft ADK, the default action when creating and formatting a partition is to disable 8.3 short file name support. Base images created using the "Boot from WinPE" option will have short file names disabled while Base images created using the "Boot from Windows media" option may have short file names enabled or disabled depending on the OS defaults.


Short file name support by OS and base image creation method

OS Boot from WinPE Boot from Windows media
Windows 10 Disabled Disabled
Windows 8, 8.1 Disabled Disabled
Windows 7 Disabled Enabled


From this table it is possible to see that short filename support when deploying Windows 7 will depend on how the base image is created.


Short file name support is generally required for legacy applications.


How to check to see if your (Windows 7) base image has the issue

  • Log in to a built machine

  • Open a command prompt and enter the following commands

    cd \
    mkdir "This is a test"
    dir /x

    If short file name support is enabled then this will result in:

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Windows\system32>cd \
    
    C:\>mkdir "This is a test"
    
    C:\>dir /x
     Volume in drive C is OS
     Volume Serial Number is 60FD-8352
    
     Directory of C:\
    
    14/07/2009  04:20    <DIR>                       PerfLogs
    23/05/2014  15:57    <DIR>          PROGRA~1     Program Files
    15/05/2014  12:33    <DIR>          PROGRA~2     Program Files (x86)
    06/06/2014  11:09    <DIR>          THISIS~1     This is a test
    08/03/2013  14:02    <DIR>                       Users
    29/05/2014  20:52    <DIR>                       Windows
    05/06/2014  11:52    <DIR>                       ztoolkit
                   0 File(s)          0 bytes
                  7 Dir(s)  21,908,264 bytes free

     If the short file/folder name entries are not listed (highlighted in green/yellow) then short file name support is disabled


Solution

Either:

  • Recreate the base image using the "Boot from Windows media" option

  • or
  • Modify the Unattended source files to enable 8.3 short file name support, recreate the WinPE boot media using the updated unattended files and recreate the base image

This TID covers the steps needed to modify the unattend source files.


NOTE: The base image will need to be recreated. It is not possible to enable 8.3 name support with an existing image.


WARNING! Warning: Do NOT perform this procedure in a production environment without first fully testing in a non-production test environment and ensure that you have adequate backups of your image files before replacing them.

Requirements

  • Imaging Toolkit
  • Project unattend source files as generated by the Build Console Deployment Wizard
  • Text editor

Procedures


Done Task
 
1. Update the unattend.bat file
 
2. Update the autounattend.xml file
 
3. Recreate WinPE ISO files
 
4. Recreate base image
 
5. Test the updated files


  1. Update the unattend.bat file


    • Browse to the <project>\WinPE\media\OS folder that contains the unattended OS install source files
    • Open the unattend.bat file in a text editor and add the lines coloured below in green/yellow:

      @ECHO OFF
      REM Unattend.bat generated by
      REM ENGL Imaging Toolkit 
      REM Copyright (C) 1999-2017 Expert Networking Group Limited
      REM W7SP1X64
      
      Echo Enable 8.3 short file name support for WinPE environment
      REG ADD HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v NtfsDisable8dot3NameCreation /t REG_DWORD /d 0 /f 
      setup.exe /unattend:"autounattend\autounattend.xml"
      
      :_EXIT
      EXIT
      
      :_END
    • Save the changes to the file
  2. Update the autounattend.xml file


    • Browse to the <project>\WinPE\media\OS\autounattend folder
    • Open the autounattend.xml file in a text editor and modify the oobeSystem section of the file as shown below in green/yellow:
       Original file section
      <settings pass="oobeSystem">
            ...
            ...
           <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            ...
            ...
            <FirstLogonCommands>
              <SynchronousCommand wcm:action="add">
                <Order>1</Order>
                <CommandLine>%SystemDrive%\Ztoolkit\Zdrvpath.exe /install /unattend</CommandLine>
                <Description>Prepares machine for deployment</Description>
              </SynchronousCommand>
            </FirstLogonCommands>
            ...
            ...
          </component>
      </settings>
       to: 
      <settings pass="oobeSystem">
            ...
            ...
           <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            ...
            ...
            <FirstLogonCommands>
              <SynchronousCommand wcm:action="add">
                 <Order> 1 </Order>
                 <CommandLine>fsutil behavior set disable8dot3 0</CommandLine>
                 <Description>enable 8.3 support </Description>
              </SynchronousCommand>
              <SynchronousCommand wcm:action="add">
                <Order> 2 </Order>
                <CommandLine>%SystemDrive%\Ztoolkit\Zdrvpath.exe /install /unattend</CommandLine>
                <Description>Prepares machine for deployment</Description>
              </SynchronousCommand>
      
            </FirstLogonCommands>
            ...
            ...
          </component>
      </settings>
      NOTE:
      1. Lines have been omitted from sample autounattend.xml file for clarity
      2. Note the American spelling of "behavior" on the fsutil command line. For further info on comandline syntax review http://technet.microsoft.com/en-us/library/ff621566.aspx

    • Save the changes to the file

  3. Recreate WinPE ISO files

    Use the ADK Makewinpemedia tool to create an updated WinPE ISO file.

    • On the Administrative computer, open the Deployment and Imaging Tools Environment Command Prompt
       Click Start, and type deployment
       Right-click Deployment and Imaging Tools Environment and then select Run as Administrator.
    • Change the command prompt location to the <project>\WinPE\media folder, for example;
      cd \ProgramData\ENGL\ImagingToolkit\projects\<project>\WinPE\media
    • Run the makewinpemedia.cmd command to create a new ISO image using the current folder as the working folder.

       The command requires the following information:
       Makewinpemedia.cmd /iso /f <WorkingDirectory> <DestinationLocation>
       where

      Commandline parameter Path
      <WorkingDirectory> .
      <DestinationLocation> ..\unattend.iso

       Giving a command line of:
      makewinpemedia.cmd /iso /f . ..\unattend.iso
      NOTE: For more information on the use of this command please review the ADK documentation

       A new unattend.iso file has now been created and can be used to make a new base image.
  4. Recreate the base image

    • Boot a target machine using the boot media created in the previous step
    • Once zdrvpath has completed shut down the machine and create a new base image as normal
  5. Test updated files

    • PXE Boot a machine
    • Select the Restore Menu
    • Select and then restore the updated SCCM project
    • The project should now restore successfully
    • The machine will now deploy successfully
    • Once the machine has built log in
    • Open a command prompt and enter the following commands
      cd \
      mkdir "this is a test"
      dir /x
       If short file name support is enabled then this will result in:
      Microsoft Windows [Version 6.1.7601]
      Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
      
      C:\Windows\system32>cd \
      
      C:\>mkdir "This is a test"
      
      C:\>dir /x
       Volume in drive C is OS
       Volume Serial Number is 60FD-8352
      
       Directory of C:\
      
      14/07/2009  04:20    <DIR>                       PerfLogs
      23/05/2014  15:57    <DIR>          PROGRA~1     Program Files
      15/05/2014  12:33    <DIR>          PROGRA~2     Program Files (x86)
      06/06/2014  11:09    <DIR>          THISIS~1     This is a test
      08/03/2013  14:02    <DIR>                       Users
      29/05/2014  20:52    <DIR>                       Windows
      05/06/2014  11:52    <DIR>                       ztoolkit
                     0 File(s)          0 bytes
                    7 Dir(s)  21,908,264 bytes free

       Short file name support is now enabled for both existing and new files and folders

If you have any problems or questions about the script or steps in this TID  please contact the ENGL support team