locked
Windows PE error, using Windows 8 ADK RRS feed

  • Question

  • Windows PE error, using Windows 8 ADK
    I am trying to build a PE iso, ran into this problem.

    Running:
    Windows 8 Professional x64
    Windows Assessment and Deployment Kit (ADK) for Windows® 8

    Command Prompt Output:

    C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment>copype Creates working directories for WinPE image customization and media creation. copype { amd64 | x86 | arm } <workingDirectory> amd64 Copies amd64 boot files and WIM to <workingDirectory>\media. x86 Copies x86 boot files and WIM to <workingDirectory>\media. arm Copies arm boot files and WIM to <workingDirectory>\media. Note: ARM content may not be present in this ADK. workingDirectory Creates the working directory at the specified location. Example: copype amd64 C:\WinPE_amd64

    When running command: copype amd64 S:\WindowsPE I receive:

    ERROR: The following processor architecture was not found: amd64.

    Saturday, March 30, 2013 9:48 AM

Answers

  • You need to edit and change the copype.cmd to the following:

    ------------------------   START   --------------------------

    @echo off
    setlocal

    set TEMPL=media
    set FWFILES=fwfiles

    rem
    rem Input validation
    rem
    if /i "%1"=="/?" goto usage
    if /i "%1"=="" goto usage
    if /i "%~2"=="" goto usage
    if /i not "%3"=="" goto usage

    rem
    rem Set environment variables for use in the script
    rem
    set WINPE_ARCH=%1
    set SOURCE=C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\%WINPE_ARCH%
    set FWFILESROOT=C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\%WINPE_ARCH%\Oscdimg
    set DEST=%~2
    set WIMSOURCEPATH=%SOURCE%\en-us\winpe.wim

    rem
    rem Validate input architecture
    rem
    rem If the source directory as per input architecture does not exist,
    rem it means the architecture is not present
    rem
    if not exist "%SOURCE%" (
      echo ERROR: The following processor architecture was not found: %WINPE_ARCH%.
      exit /b 1
    )

    rem
    rem Validate the boot app directory location
    rem
    rem If the input architecture is validated, this directory must exist
    rem This check is only to be extra careful
    rem
    if not exist "%FWFILESROOT%" (
      echo ERROR: The following path for firmware files was not found: "%FWFILESROOT%".
      exit /b 1
    )

    rem
    rem Make sure the appropriate winpe.wim is present
    rem
    if not exist "%WIMSOURCEPATH%" (
      echo ERROR: WinPE WIM file does not exist: "%WIMSOURCEPATH%".
      exit /b 1
    )

    rem
    rem Make sure the destination directory does not exist
    rem
    if exist "%DEST%" (
      echo ERROR: Destination directory exists: %2.
      exit /b 1
    )

    mkdir "%DEST%"
    if errorlevel 1 (
      echo ERROR: Unable to create destination: %2.
      exit /b 1
    )

    echo.
    echo ===================================================
    echo Creating Windows PE customization working directory
    echo.
    echo     %DEST%
    echo ===================================================
    echo.

    mkdir "%DEST%\%TEMPL%"
    if errorlevel 1 goto :FAIL
    mkdir "%DEST%\mount"
    if errorlevel 1 goto :FAIL
    mkdir "%DEST%\%FWFILES%"
    if errorlevel 1 goto :FAIL

    rem
    rem Copy the boot files and WinPE WIM to the destination location
    rem
    xcopy /cherky "%SOURCE%\Media" "%DEST%\%TEMPL%\"
    if errorlevel 1 goto :FAIL
    mkdir "%DEST%\%TEMPL%\sources"
    if errorlevel 1 goto :FAIL
    copy "%WIMSOURCEPATH%" "%DEST%\%TEMPL%\sources\boot.wim"
    if errorlevel 1 goto :FAIL

    rem
    rem Copy the boot apps to enable ISO boot
    rem
    rem  UEFI boot uses efisys.bin
    rem  BIOS boot uses etfsboot.com
    rem
    copy "%FWFILESROOT%\efisys.bin" "%DEST%\%FWFILES%"
    if errorlevel 1 goto :FAIL
    if exist "%FWFILESROOT%\etfsboot.com" (
      copy "%FWFILESROOT%\etfsboot.com" "%DEST%\%FWFILES%"
      if errorlevel 1 goto :FAIL
    )

    endlocal
    echo.
    echo Success
    echo.

    cd /d "%~2"

    goto :EOF

    :usage
    echo Creates working directories for WinPE image customization and media creation.
    echo.
    echo copype { amd64 ^| x86 ^| arm } ^<workingDirectory^>
    echo.
    echo  amd64             Copies amd64 boot files and WIM to ^<workingDirectory^>\media.
    echo  x86               Copies x86 boot files and WIM to ^<workingDirectory^>\media.
    echo  arm               Copies arm boot files and WIM to ^<workingDirectory^>\media.
    echo                    Note: ARM content may not be present in this ADK.
    echo  workingDirectory  Creates the working directory at the specified location.
    echo.
    echo Example: copype amd64 C:\WinPE_amd64
    goto :EOF

    :FAIL
    echo ERROR: Failed to create working directory.

    ------------------------ END --------------------------

    Then for the running the script MakeWinPEMedia.cmd you need to copy all the files from:

    C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg

    Into

    C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment

    ------

    If your making a 32 bit PE you need to copy all the files from:

    C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\x86\Oscdimg

    Into

    C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment

    ------

    Clearly someone at Microsoft is retarded :) I discovered your post trying to figure out how to do this myself. After not finding an answer I figured it out on my own.




    • Edited by wjsorensen Monday, April 1, 2013 7:34 PM
    • Proposed as answer by wjsorensen Monday, April 1, 2013 7:44 PM
    • Marked as answer by Juke Chou Sunday, April 7, 2013 3:03 PM
    Monday, April 1, 2013 7:29 PM

All replies

  • Did you try to run the PE command line as Administrator? 

    Saturday, March 30, 2013 3:34 PM
  • Yes, running an elevated cmd.
    Saturday, March 30, 2013 7:42 PM
  • Hi,

    I suggest you reinstall WAIK and try again. The architecture amd64 is missing.


    Juke Chou
    TechNet Community Support

    Monday, April 1, 2013 10:08 AM
  • No, I am using Windows Assessment and Deployment Kit (ADK).

    WAIK applies to Windows 7 / Server 2008, ADK is the updated version of WAIK

    Monday, April 1, 2013 11:40 AM
  • No, I am using Windows Assessment and Deployment Kit (ADK).

    WAIK applies to Windows 7 / Server 2008, ADK is the updated version of WAIK


    You have to reinstall the ADK because AMD64 is missing on your installation. Otherwise, you can build a x86 PE, because it works to capture x64 images as well. 
    Monday, April 1, 2013 1:54 PM
  • You need to edit and change the copype.cmd to the following:

    ------------------------   START   --------------------------

    @echo off
    setlocal

    set TEMPL=media
    set FWFILES=fwfiles

    rem
    rem Input validation
    rem
    if /i "%1"=="/?" goto usage
    if /i "%1"=="" goto usage
    if /i "%~2"=="" goto usage
    if /i not "%3"=="" goto usage

    rem
    rem Set environment variables for use in the script
    rem
    set WINPE_ARCH=%1
    set SOURCE=C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\%WINPE_ARCH%
    set FWFILESROOT=C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\%WINPE_ARCH%\Oscdimg
    set DEST=%~2
    set WIMSOURCEPATH=%SOURCE%\en-us\winpe.wim

    rem
    rem Validate input architecture
    rem
    rem If the source directory as per input architecture does not exist,
    rem it means the architecture is not present
    rem
    if not exist "%SOURCE%" (
      echo ERROR: The following processor architecture was not found: %WINPE_ARCH%.
      exit /b 1
    )

    rem
    rem Validate the boot app directory location
    rem
    rem If the input architecture is validated, this directory must exist
    rem This check is only to be extra careful
    rem
    if not exist "%FWFILESROOT%" (
      echo ERROR: The following path for firmware files was not found: "%FWFILESROOT%".
      exit /b 1
    )

    rem
    rem Make sure the appropriate winpe.wim is present
    rem
    if not exist "%WIMSOURCEPATH%" (
      echo ERROR: WinPE WIM file does not exist: "%WIMSOURCEPATH%".
      exit /b 1
    )

    rem
    rem Make sure the destination directory does not exist
    rem
    if exist "%DEST%" (
      echo ERROR: Destination directory exists: %2.
      exit /b 1
    )

    mkdir "%DEST%"
    if errorlevel 1 (
      echo ERROR: Unable to create destination: %2.
      exit /b 1
    )

    echo.
    echo ===================================================
    echo Creating Windows PE customization working directory
    echo.
    echo     %DEST%
    echo ===================================================
    echo.

    mkdir "%DEST%\%TEMPL%"
    if errorlevel 1 goto :FAIL
    mkdir "%DEST%\mount"
    if errorlevel 1 goto :FAIL
    mkdir "%DEST%\%FWFILES%"
    if errorlevel 1 goto :FAIL

    rem
    rem Copy the boot files and WinPE WIM to the destination location
    rem
    xcopy /cherky "%SOURCE%\Media" "%DEST%\%TEMPL%\"
    if errorlevel 1 goto :FAIL
    mkdir "%DEST%\%TEMPL%\sources"
    if errorlevel 1 goto :FAIL
    copy "%WIMSOURCEPATH%" "%DEST%\%TEMPL%\sources\boot.wim"
    if errorlevel 1 goto :FAIL

    rem
    rem Copy the boot apps to enable ISO boot
    rem
    rem  UEFI boot uses efisys.bin
    rem  BIOS boot uses etfsboot.com
    rem
    copy "%FWFILESROOT%\efisys.bin" "%DEST%\%FWFILES%"
    if errorlevel 1 goto :FAIL
    if exist "%FWFILESROOT%\etfsboot.com" (
      copy "%FWFILESROOT%\etfsboot.com" "%DEST%\%FWFILES%"
      if errorlevel 1 goto :FAIL
    )

    endlocal
    echo.
    echo Success
    echo.

    cd /d "%~2"

    goto :EOF

    :usage
    echo Creates working directories for WinPE image customization and media creation.
    echo.
    echo copype { amd64 ^| x86 ^| arm } ^<workingDirectory^>
    echo.
    echo  amd64             Copies amd64 boot files and WIM to ^<workingDirectory^>\media.
    echo  x86               Copies x86 boot files and WIM to ^<workingDirectory^>\media.
    echo  arm               Copies arm boot files and WIM to ^<workingDirectory^>\media.
    echo                    Note: ARM content may not be present in this ADK.
    echo  workingDirectory  Creates the working directory at the specified location.
    echo.
    echo Example: copype amd64 C:\WinPE_amd64
    goto :EOF

    :FAIL
    echo ERROR: Failed to create working directory.

    ------------------------ END --------------------------

    Then for the running the script MakeWinPEMedia.cmd you need to copy all the files from:

    C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg

    Into

    C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment

    ------

    If your making a 32 bit PE you need to copy all the files from:

    C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\x86\Oscdimg

    Into

    C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment

    ------

    Clearly someone at Microsoft is retarded :) I discovered your post trying to figure out how to do this myself. After not finding an answer I figured it out on my own.




    • Edited by wjsorensen Monday, April 1, 2013 7:34 PM
    • Proposed as answer by wjsorensen Monday, April 1, 2013 7:44 PM
    • Marked as answer by Juke Chou Sunday, April 7, 2013 3:03 PM
    Monday, April 1, 2013 7:29 PM
  • Outstaning find.  Thanks wjsorensen.


    Anybody that experiences this issue, please follow the instructions posted here, as they will fix the issue.  *Side note, that if you install the ADK into a different directory, other than default - be sure to update these two lines in the cmd:

    set SOURCE=C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\%WINPE_ARCH%
    set FWFILESROOT=C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\%WINPE_ARCH%\Oscdimg

    Update them to wherever ADK has been installed (if not default).  - And please share the love for  wjsorensen by "upvoting" him if the same solution worked for you.

    • Proposed as answer by Durga Pathak Saturday, December 8, 2018 9:19 AM
    Sunday, May 26, 2013 3:13 AM
  • please mind that windows 8.1 adk has a different path (!) therefore i suggest you correct lines 19+20 and use relative folder structures using batch variables

    set SOURCE=%~dp0\%WINPE_ARCH%
    set FWFILESROOT=%~dp0\..\Deployment Tools\%WINPE_ARCH%\Oscdimg

    Mind: u can only edit copype.cmd with administrator privileges


    • Edited by Gizmo0001 Tuesday, November 5, 2013 10:14 PM
    • Proposed as answer by ianthenerd Tuesday, June 26, 2018 2:26 PM
    • Unproposed as answer by ianthenerd Tuesday, June 26, 2018 2:28 PM
    Tuesday, November 5, 2013 10:07 PM
  • I had the same issue. I was being a n00b and not using Deployment Tools Command Prompt.
    • Proposed as answer by tonyc66 Wednesday, August 5, 2015 12:43 PM
    Wednesday, November 13, 2013 8:58 PM
  • Hi Maybe a bit late but this error you get because you are missing the variables.

    If you start the created link by the installation called "Deployment and Imaging Tools Environment"

    the variables are there and you are ready to go. No hustle to change scripts and stuff.

    Kind regards

    Bauke Plugge

    Monday, December 30, 2013 7:42 PM
  • if using windows 8.1, then "8.0" in the above should be changed to "8.1"; as that is the default install directory for ADK

    Aravind Ramarathinam

    Wednesday, March 26, 2014 7:27 PM
  • Rewriting the entire script is overkill.

    The problem is that two environment variables have not been declared - WinPERoot and OSCDImgRoot. Declare them as follows:

    • setx.exe WinPERoot "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment" /m
    • setx.exe OSCDImgRoot "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg" /m

    A few points:

    • The /m at the end of the command sets the environment variable for the system instead of for the session. Remove this to have be available for just this session;
    • You notice that the OSCDImgRoot specifies \amd64\Oscdimg - even if you are running x86 you should just leave this. If you notice the variable is set using it (FWFILESROOT=%OSCDImgRoot%\..\..\%WINPE_ARCH%\Oscdimg) steps down two directories before being set so you will still get to your x86 directory regardless.

    The reason I suggest not changing the script is that it may change in a future version.

    Once the above change was made the copype.cmd worked first time.

    Alternatively to all of this don't run the script from a generic command shell. Run "Deployment and Imaging Tools Environment" from Start->Windows Kits - this runs a batch file which sets many environment variables for you.

    Hope this helps somebody.





    Sunday, January 11, 2015 12:59 PM
  • I had the same issue. I was being a n00b and not using Deployment Tools Command Prompt.

    lol, I had the same issue as well and you were right on the money!

    I missed  the step in my instructions by assuming they were using the standard command prompt. Using the Deployment and Imaging Tools Environment prompt does fix this issue.

    Tuesday, January 13, 2015 3:34 PM
  • You sir are the man.

    For those of you who would like to know what the %~dp0 command line does read it below.

    https://stackoverflow.com/questions/5034076/what-does-dp0-mean-and-how-does-it-work

    Thursday, May 14, 2015 5:03 PM
  • Hi,
    I had the same problem in windows ADK for windows 10 and it help for me.
    dont forget to change
    "...(x86)\Windows Kits\8.0\Assessment ..." --> "...(x86)\Windows Kits\10\Assessment ..."


    Best Regards, gavraham

    Wednesday, March 30, 2016 10:10 PM
  • I too had the same problem. I am using the windows 10 PE , I checked and the ADK install added the correct path in the path statement just like it shows in the deployment tools command prompt. so a regular command prompt should work but does not
    Friday, June 2, 2017 8:47 PM
  • Just run as administrator the bat script named "DandISetEnv.bat" that is in Deployment Tools folder, It will set up all the required environment variables that copype.cmd requires.
    • Proposed as answer by JRLOPS Wednesday, October 25, 2017 3:46 AM
    Wednesday, October 25, 2017 3:46 AM
  • Not Retarded, YOU must do it the way it was intended and designed to be used. The fact you have a way to do it differently means Microsoft put a considerable amount of time in developing the Windows Preinstallation Environment (Windows PE), so it would be flexible for many uses. They designed it for making their life and your life to be easier with Windows installations and other task. Then they provided it for you to use it for FREE.  Good job for doing it the hard way then insulting the hand that fed you a free meal! 😊

    Now Follow the instructions:

    1.)          Download and Install SDK of Choice.

    Windows 7:

    "https://www.microsoft.com/en-us/download/confirmation.aspx?id=5753"

    Windows 8.1:

    "https://www.microsoft.com/en-us/download/confirmation.aspx?id=39982"

    Windows 10:

    "https://support.microsoft.com/en-us/help/4027209/oems-adk-download-for-windows-10"

    1.)          Restart Your computer.

    2.)          Navigate through your start menu: Start Menu>Windows Kits>Deployment and Imaging Tools Environment.

    3.)          Now Click on (Deployment and Imaging Tools Environment)

    4.)          Wait for (Deployment and Imaging Tools Environment) command window to load.

    5.)          Type the required command:

    “copype amd64 C:\WinPE10_amd64

    6.)          Press “Enter” and wait for process to complete.

    7.)          Navigate to C:\ in Windows Explorer.

    8.)          Now Double Click on your supplied directory, in this case “WinPE10_amd64”

    Voila, not retards after all!



    • Edited by badonj001 Friday, September 28, 2018 11:52 AM
    • Proposed as answer by Benoit N Friday, October 4, 2019 11:22 AM
    Friday, September 28, 2018 11:50 AM