So führen Sie copype.cmd für WinPE aus der Batchdatei aus

1902
Mark Deven

Ich schreibe ein Tool, das ein WinPE-Laufwerk für Sie einrichtet, und ich habe DISM-Befehle aus einer Admin-Batchdatei aufgerufen. Ich kann jedoch nicht herausfinden, wie der Copype-Befehl ausgeführt wird, um das Laufwerk anfangs einzurichten.

"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\copype.cmd"Das Copype-Tool befindet sich jedoch dort, wenn es mit dism mit diesem Befehl aufgerufen wird: Dism "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\copype.cmd" amd64 C:\WinPE_amd64Es antwortet, dass Dism doesn't recognise the command-line option "copype.cmd"ich die Datei amd64 nicht finden kann, wenn ich versuche, die Datei direkt von einer Eingabeaufforderung aus auszuführen. Der einzige Weg, den ich zum Starten bringen kann, ist, wenn ich eine Umgebung mit Implementierungs- und Imaging-Tools für Administratoren und den Copype-Befehl ausführe. Es muss einen Weg geben, dies zu tun, aber ich kann nicht herausfinden, wie.

0

2 Antworten auf die Frage

0
Mark Deven

Es stellte sich heraus, dass Windows ADK Copype seit Windows 8 etwas kaputt ist. Es fehlt eine Variable. Wenn Sie dies in Ihre Batch-Datei schreiben, können Sie call :copypeBefehle dazu aufrufen:

:copype 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\10\Assessment and Deployment Kit\Windows Preinstallation Environment\%WINPE_ARCH% set FWFILESROOT=C:\Program Files (x86)\Windows Kits\10\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. set EROP=YEs exit /b 1 Rem CopyPE created by Microsoft and Edited by Lucas Elliott and wjsorensen on technet ::------------------------ END -------------------------- 

Für jeden, der Windows 8 verwendet, können Sie seine Lösung hier einsehen: https://social.technet.microsoft.com/Forums/ie/en-US/1155d38c-e7fd-4b4f-a31c-26875d4f47a7/windows-pe-error-using -windows-8-adk? forum = w8itproinstall

0
Enrico

Ähm, ich habe hier nach Informationen über Copype gesucht und dem Link zum Technet-Forum gefolgt. Es gibt einen neuen Beitrag von vor wenigen Tagen - ich empfehle dringend, ihn zu lesen. Kurz gesagt, Copype ist in keiner Weise fehlerhaft: Es ist lediglich für die Ausführung in der ADK-Umgebung gedacht (die Eingabeaufforderung von cmd wird durch Klicken auf den entsprechenden Link in Start -> Alle Programme -> Windows Kits -> Windows ADK aufgerufen). (Nun, dies ist der Pfad unter Windows 7: Ich habe Windows 8 ADK (Version 6.3.9600.17029) unter Windows 7 installiert, unter Windows 8 und wahrscheinlich auch unter Windows 10 wird der Pfad aufgrund des unterschiedlichen Layouts etwas anders sein des Startmenüs.)

Ja, unter Windows 10 ist alles anders. Mark Deven vor 5 Jahren 0