Good to Know Database

Einzelne Sprachen einer mehrsprachigen Windows 8 Installations-DVD entfernen


Wenn Sie wie im Artikel Windows 8 Installations-DVD mit zusätzlichen Sprachen ausstatten beschrieben eine Windows 8 Installations-DVD mit zusätzlichen Sprachen ausgestattet haben und jetzt eine oder mehrere Sprachen wieder entfernen wollen, hilft Ihnen das folgende Batch-Skript weiter.

Voraussetzungen:
- Eine mehrsprachige Windows 8 x86 oder x64 Installations-DVD.
- Ein lauffähiges Windows 8 x86 beziehungsweise x64 System mit 15GB freien Speicherplatz.
- Auf dem System muss das Windows Assessment and Deployment Kit (ADK) für Windows 8 installiert sein.

Nachdem Sie alle Voraussetzungen erfüllt haben, müssen Sie im Batch-Skript die Variablen DVDDRIVE, WIN8ARCH, LANGUAGES, LANGUAGEn, DEFAULTLANGUAGE, DEFAULTTIMEZONE, SETUPLANGUAGE und gegebenenfalls auch WIN8DVDDIR, WIN8DVDISO und TEMPDIR an Ihre Anforderungen anpassen. Danach führen Sie das Batch-Skript als Administrator aus.

@echo off

rem
rem Remove languages from multilingual Windows 8 x86/x64 DVD
rem
rem 20121228 v1.0    Remove languages from multilingual Windows 8 x86/x64 DVD
rem 20130402 v1.1    Add UEFI support
rem 20130616 v1.2    Revise count of available Windows 8 versions
rem

rem Current working directory
rem Please don't touch!
set WORKDIR=%~dp0

rem Drive letter of your DVD drive (e.g. "F:")
set DVDDRIVE=F:

rem Architecture of the Windows 8 DVD
rem Set "x86" for 32 bit architecture
rem Set "amd64" for 64 bit architecture
set WIN8ARCH=amd64

rem Temporary directory to store the Windows 8 DVD content (e.g. "D:\Win8_DVD")
set WIN8DVDDIR=%WORKDIR%\Win8_%WIN8ARCH%_DVD

rem Path and filename for the ISO output file (e.g. "D:\Win8_MUI_DVD.iso")
set WIN8DVDISO=%WORKDIR%\Win8_%WIN8ARCH%_MUI_DVD.iso

rem Create bootable DVD image for PC-BIOS or UEFI
rem Set "bios" for BIOS bootable DVD image
rem Set "uefi" for BIOS and UEFI bootable DVD image
set WIN8DVDBOOT=uefi

rem Number of language packs to remove
set LANGUAGES=2

rem List of languages to be removed (e.g. "de-de" or "en-us")
set LANGUAGE1=en-gb
set LANGUAGE2=en-us
set LANGUAGE3=
set LANGUAGE4=
set LANGUAGE5=
set LANGUAGE6=
set LANGUAGE7=
set LANGUAGE8=
set LANGUAGE9=

rem Set the default system UI language, the language for non-Unicode programs, the "standards and formats" language, the input locales, the keyboard layouts and time zone values to the specified language
set DEFAULTLANGUAGE=de-de

rem Set the default time zone in the Windows image
set DEFAULTTIMEZONE="Central Europe Standard Time"

rem Define the default language that will be used by setup
set SETUPLANGUAGE=de-de

rem Some temporary working directories
set TEMPDIR=%WORKDIR%\Win8_%WIN8ARCH%_TEMP
set EXTRACTDIR=%TEMPDIR%\extract
set LPEXTRACTDIR=%EXTRACTDIR%\languagepack
set PEEXTRACTDIR=%EXTRACTDIR%\winpe
set MOUNTDIR=%TEMPDIR%\mount
set INSTALLMOUNTDIR=%MOUNTDIR%\install
set WINREMOUNTDIR=%MOUNTDIR%\winre
set BOOTMOUNTDIR=%MOUNTDIR%\boot

rem Path to the Windows Assessment and Deployment Kit
set KITPATH=
if exist "C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit" set KITPATH=C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit
if "%KITPATH%"=="" goto E_KITPATH

rem ###################################################################
rem # NORMALLY THERE IS NO NEED TO CHANGE ANYTHING BELOW THIS COMMENT #
rem ###################################################################

setlocal EnableDelayedExpansion

echo.
echo ==================================================================
echo Remove temporary directories if they already exist
echo ==================================================================
echo.
if exist "%WIN8DVDDIR%" rmdir /s /q "%WIN8DVDDIR%"
if errorlevel 1 goto E_DELDIR
if exist "%TEMPDIR%" rmdir /s /q "%TEMPDIR%"
if errorlevel 1 goto E_DELDIR

echo.
echo ==================================================================
echo Create temporary directories
echo ==================================================================
echo.
mkdir "%WIN8DVDDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%TEMPDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%LPEXTRACTDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%PEEXTRACTDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%MOUNTDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%INSTALLMOUNTDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%WINREMOUNTDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%BOOTMOUNTDIR%"
if errorlevel 1 goto E_MKDIR

echo.
echo ==================================================================
echo Copy Windows 8 DVD to the temporary directory
echo ==================================================================
echo.
echo Please insert the Windows 8 %WIN8ARCH% DVD into the DVD drive %DVDDRIVE%
echo.
pause
xcopy "%DVDDRIVE%\*.*" "%WIN8DVDDIR%" /ef

rem Set count of available Windows 8 versions
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Get-WimInfo /WimFile:"%WIN8DVDDIR%\sources\install.wim" > "%TEMPDIR%\wiminfo.txt"
for /F "tokens=2 delims=: " %%a in ('findstr /e "\"[0-9]\"" "%TEMPDIR%\wiminfo.txt"') do (
  set VERSIONS=%%~a
)
del /f /q "%TEMPDIR%\wiminfo.txt"

echo.
echo ==================================================================
echo Remove language packs from the installation image
echo ==================================================================
echo.

for /L %%i in (1, 1, %VERSIONS%) do (
  echo.
  echo ==================================================================
  echo Mount install.wim - %%i of %VERSIONS%
  echo ==================================================================
  echo.
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Mount-Wim /WimFile:"%WIN8DVDDIR%\sources\install.wim" /Index:%%i /MountDir:"%INSTALLMOUNTDIR%"
  if errorlevel 1 goto E_MOUNT

  echo.
  echo ==================================================================
  echo Remove language packs from install.wim - %%i of %VERSIONS%
  echo ==================================================================
  echo.
  for /L %%j in (1, 1, %LANGUAGES%) do (
    "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%INSTALLMOUNTDIR%" /Remove-Package /PackageName:Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  )

  echo.
  echo ==================================================================
  echo Update default settings of install.wim - %%i of %VERSIONS%
  echo ==================================================================
  echo.
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%INSTALLMOUNTDIR%" /Gen-LangIni /Distribution:"%WIN8DVDDIR%"
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%INSTALLMOUNTDIR%" /Set-AllIntl:%DEFAULTLANGUAGE%
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%INSTALLMOUNTDIR%" /Set-SKUIntlDefaults:%DEFAULTLANGUAGE%
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%INSTALLMOUNTDIR%" /Set-TimeZone:%DEFAULTTIMEZONE%
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%INSTALLMOUNTDIR%" /Set-SetupUILang:%SETUPLANGUAGE% /Distribution:"%WIN8DVDDIR%"

  echo.
  echo ==================================================================
  echo Get package list and language settings of install.wim - %%i of %VERSIONS%
  echo ==================================================================
  echo.
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%INSTALLMOUNTDIR%" /Get-Packages /Format:Table
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%INSTALLMOUNTDIR%" /Get-Intl

  echo.
  echo ==================================================================
  echo Extract winre.wim - %%i of %VERSIONS%
  echo ==================================================================
  echo.
  if not exist "%TEMPDIR%\winre.wim" copy "%INSTALLMOUNTDIR%\Windows\System32\Recovery\winre.wim" "%TEMPDIR%\" /y

  echo.
  echo ==================================================================
  echo Unmount install.wim - %%i of %VERSIONS%
  echo ==================================================================
  echo.
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Unmount-Wim /MountDir:"%INSTALLMOUNTDIR%" /Commit
  if errorlevel 1 goto E_UNMOUNT
)

echo.
echo ==================================================================
echo Remove language packs from the WinRE image
echo ==================================================================
echo.

echo.
echo ==================================================================
echo Mount winre.wim
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Mount-Wim /WimFile:"%TEMPDIR%\winre.wim" /Index:1 /MountDir:"%WINREMOUNTDIR%"
if errorlevel 1 goto E_MOUNT

echo.
echo ==================================================================
echo Remove language packs from winre.wim
echo ==================================================================
echo.
for /L %%j in (1, 1, %LANGUAGES%) do (
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Remove-Package /PackageName:Microsoft-Windows-WinPE-LanguagePack-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Remove-Package /PackageName:WinPE-EnhancedStorage-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  rem No localized version of WinPE-IbsProvider package available! Keep en-us version!
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Remove-Package /PackageName:WinPE-Scripting-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Remove-Package /PackageName:WinPE-SecureStartup-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Remove-Package /PackageName:WinPE-SRT-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Remove-Package /PackageName:WinPE-WDS-Tools-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Remove-Package /PackageName:WinPE-WMI-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
)

echo.
echo ==================================================================
echo Update default settings of winre.wim
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Gen-LangIni /Distribution:"%WINREMOUNTDIR%"
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Set-AllIntl:%DEFAULTLANGUAGE%
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Set-SKUIntlDefaults:%DEFAULTLANGUAGE%
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Set-TimeZone:%DEFAULTTIMEZONE%
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Set-SetupUILang:%SETUPLANGUAGE% /Distribution:"%WINREMOUNTDIR%"

echo.
echo ==================================================================
echo Get package list and language settings of winre.wim
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Get-Packages /Format:Table
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%WINREMOUNTDIR%" /Get-Intl

echo.
echo ==================================================================
echo Unmount winre.wim
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Unmount-Wim /MountDir:"%WINREMOUNTDIR%" /Commit
if errorlevel 1 goto E_UNMOUNT

echo.
echo ==================================================================
echo Add updated winre.wim to the installation image
echo ==================================================================
echo.

for /L %%i in (1, 1, %VERSIONS%) do (
  echo.
  echo ==================================================================
  echo Mount install.wim - %%i of %VERSIONS%
  echo ==================================================================
  echo.
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Mount-Wim /WimFile:"%WIN8DVDDIR%\sources\install.wim" /Index:%%i /MountDir:"%INSTALLMOUNTDIR%"
  if errorlevel 1 goto E_MOUNT

  echo.
  echo ==================================================================
  echo Update winre.wim - %%i of %VERSIONS%
  echo ==================================================================
  echo.
  copy "%TEMPDIR%\winre.wim" "%INSTALLMOUNTDIR%\Windows\System32\Recovery\" /y

  echo.
  echo ==================================================================
  echo Unmount install.wim - %%i of %VERSIONS%
  echo ==================================================================
  echo.
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Unmount-Wim /MountDir:"%INSTALLMOUNTDIR%" /Commit
  if errorlevel 1 goto E_UNMOUNT
)

echo.
echo ==================================================================
echo Remove language pack files from the Windows 8 DVD
echo ==================================================================
echo.
for /L %%j in (1, 1, %LANGUAGES%) do (
  echo.
  echo ==================================================================
  echo Remove language pack files from the DVD folder - !LANGUAGE%%j!
  echo ==================================================================
  echo.
  rem Remove language pack files from \boot\
  rmdir /s /q "%WIN8DVDDIR%\boot\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\
  rmdir /s /q "%WIN8DVDDIR%\sources\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\dlmanifests\
  rmdir /s /q "%WIN8DVDDIR%\sources\dlmanifests\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\dlmanifests\microsoft-windows-iasserver-migplugin\
  if "%WIN8ARCH%"=="x86" rmdir /s /q "%WIN8DVDDIR%\sources\dlmanifests\microsoft-windows-iasserver-migplugin\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\dlmanifests\microsoft-windows-storagemigration\
  rmdir /s /q "%WIN8DVDDIR%\sources\dlmanifests\microsoft-windows-storagemigration\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\dlmanifests\microsoft-windows-sxs\
  rmdir /s /q "%WIN8DVDDIR%\sources\dlmanifests\microsoft-windows-sxs\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\etwproviders\
  rmdir /s /q "%WIN8DVDDIR%\sources\etwproviders\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\migration\wtr\
  rem No localized version of "adminpack_en-us.inf" available! Keep en-us version!
  rem No localized version of "adminpack_en-us_noloc.inf" available! Keep en-us version!
  rem No localized version of "ftp_7.5_en-us_noloc.inf" available! Keep en-us version!
  rem No localized version of "powershell_en-us_noloc.inf" available! Keep en-us version!
  rem No localized version of "webdav_7.5_en-us_noloc.inf" available! Keep en-us version!

  rem Remove language pack files from \sources\replacementmanifests\
  rmdir /s /q "%WIN8DVDDIR%\sources\replacementmanifests\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\replacementmanifests\microsoft-windows-offlinefiles-core\
  rmdir /s /q "%WIN8DVDDIR%\sources\replacementmanifests\microsoft-windows-offlinefiles-core\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\replacementmanifests\microsoft-windows-storagemigration\
  rmdir /s /q "%WIN8DVDDIR%\sources\replacementmanifests\microsoft-windows-storagemigration\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\replacementmanifests\microsoft-windows-sxs\
  rmdir /s /q "%WIN8DVDDIR%\sources\replacementmanifests\microsoft-windows-sxs\!LANGUAGE%%j!"

  rem Remove language pack files from \sources\sxs\
  if "%WIN8ARCH%"=="amd64" (
    dir /s /b /a:d "%WIN8DVDDIR%\sources\sxs\amd64_microsoft-windows-wcfcorecomp.resources_31bf3856ad364e35_6.2.9200.16384_!LANGUAGE%%j!_*" > "%TEMPDIR%\search.txt"
    for /f "delims=" %%a in (%TEMPDIR%\search.txt) do rmdir /s /q "%%a"
    dir /s /b /a:d "%WIN8DVDDIR%\sources\sxs\amd64_microsoft-windows-wpfcorecomp.resources_31bf3856ad364e35_6.2.9200.16384_!LANGUAGE%%j!_*" > "%TEMPDIR%\search.txt"
    for /f "delims=" %%a in (%TEMPDIR%\search.txt) do rmdir /s /q "%%a"
    dir /s /b /a:d "%WIN8DVDDIR%\sources\sxs\wow64_microsoft-windows-wcfcorecomp.resources_31bf3856ad364e35_6.2.9200.16384_!LANGUAGE%%j!_*" > "%TEMPDIR%\search.txt"
    for /f "delims=" %%a in (%TEMPDIR%\search.txt) do rmdir /s /q "%%a"
  )
  if "%WIN8ARCH%"=="x86" (
    dir /s /b /a:d "%WIN8DVDDIR%\sources\sxs\x86_microsoft-windows-wcfcorecomp.resources_31bf3856ad364e35_6.2.9200.16384_!LANGUAGE%%j!_*" > "%TEMPDIR%\search.txt"
    for /f "delims=" %%a in (%TEMPDIR%\search.txt) do rmdir /s /q "%%a"
  )
  dir /s /b /a:d "%WIN8DVDDIR%\sources\sxs\x86_microsoft-windows-wpfcorecomp.resources_31bf3856ad364e35_6.2.9200.16384_!LANGUAGE%%j!_*" > "%TEMPDIR%\search.txt"
  for /f "delims=" %%a in (%TEMPDIR%\search.txt) do rmdir /s /q "%%a"
  dir /s /b /a:d "%WIN8DVDDIR%\sources\sxs\x86_microsoft-windows-wwfcorecomp.resources_31bf3856ad364e35_6.2.9200.16384_!LANGUAGE%%j!_*" > "%TEMPDIR%\search.txt"
  for /f "delims=" %%a in (%TEMPDIR%\search.txt) do rmdir /s /q "%%a"

  rem Remove language pack files from \support\logging\
  rmdir /s /q "%WIN8DVDDIR%\support\logging\!LANGUAGE%%j!"

  rem Remove language pack files from \support\migwiz\
  rmdir /s /q "%WIN8DVDDIR%\support\migwiz\!LANGUAGE%%j!"

  del /f /q "%TEMPDIR%\search.txt"
)

echo.
echo ==================================================================
echo Remove language pack files from the boot images
echo ==================================================================
echo.

echo.
echo ==================================================================
echo Mount boot.wim - 1 of 2
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Mount-Wim /WimFile:"%WIN8DVDDIR%\sources\boot.wim" /Index:1 /MountDir:"%BOOTMOUNTDIR%"
if errorlevel 1 goto E_MOUNT

echo.
echo ==================================================================
echo Remove language packs from boot.wim - 1 of 2
echo ==================================================================
echo.
for /L %%j in (1, 1, %LANGUAGES%) do (
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:Microsoft-Windows-WinPE-LanguagePack-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-EnhancedStorage-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  rem No localized version of WinPE-IbsProvider package available! Keep en-us version!
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-Scripting-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-SecureStartup-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-SRT-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-WDS-Tools-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-WMI-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
)

echo.
echo ==================================================================
echo Update default settings of boot.wim - 1 of 2
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Gen-LangIni /Distribution:"%BOOTMOUNTDIR%"
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Set-AllIntl:%DEFAULTLANGUAGE%
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Set-SKUIntlDefaults:%DEFAULTLANGUAGE%
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Set-TimeZone:%DEFAULTTIMEZONE%
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Set-SetupUILang:%SETUPLANGUAGE% /Distribution:"%BOOTMOUNTDIR%"

echo.
echo ==================================================================
echo Get package list and language settings of boot.wim - 1 of 2
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Get-Packages /Format:Table
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Get-Intl

echo.
echo ==================================================================
echo Unmount boot.wim - 1 of 2
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Unmount-Wim /MountDir:"%BOOTMOUNTDIR%" /Commit
if errorlevel 1 goto E_UNMOUNT

echo.
echo ==================================================================
echo Mount boot.wim - 2 of 2
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Mount-Wim /WimFile:"%WIN8DVDDIR%\sources\boot.wim" /Index:2 /MountDir:"%BOOTMOUNTDIR%"
if errorlevel 1 goto E_MOUNT

echo.
echo ==================================================================
echo Remove language packs from boot.wim - 2 of 2
echo ==================================================================
echo.
for /L %%j in (1, 1, %LANGUAGES%) do (
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:Microsoft-Windows-WinPE-LanguagePack-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-EnhancedStorage-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  rem No localized version of WinPE-IbsProvider package available! Keep en-us version!
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-Scripting-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-SecureStartup-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-Setup-Client-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-Setup-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-SRT-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-WDS-Tools-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
  "%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Remove-Package /PackageName:WinPE-WMI-Package~31bf3856ad364e35~%WIN8ARCH%~!LANGUAGE%%j!~6.2.9200.16384
)

echo.
echo ==================================================================
echo Update default settings of boot.wim - 2 of 2
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Gen-LangIni /Distribution:"%BOOTMOUNTDIR%"
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Set-AllIntl:%DEFAULTLANGUAGE%
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Set-SKUIntlDefaults:%DEFAULTLANGUAGE%
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Set-TimeZone:%DEFAULTTIMEZONE%
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Set-SetupUILang:%SETUPLANGUAGE% /Distribution:"%BOOTMOUNTDIR%"

echo.
echo ==================================================================
echo Get package list and language settings of boot.wim - 2 of 2
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Get-Packages /Format:Table
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Image:"%BOOTMOUNTDIR%" /Get-Intl

echo.
echo ==================================================================
echo Unmount boot.wim - 2 of 2
echo ==================================================================
echo.
"%KITPATH%\Deployment Tools\x86\DISM\dism.exe" /Unmount-Wim /MountDir:"%BOOTMOUNTDIR%" /Commit
if errorlevel 1 goto E_UNMOUNT

echo.
echo ==================================================================
echo Create Windows 8 %WIN8ARCH% MUI ISO image
echo ==================================================================
echo.
if "%WIN8DVDBOOT%"=="uefi" (
  "%KITPATH%\Deployment Tools\x86\Oscdimg\oscdimg.exe" -m -o -u2 -udfver102 -bootdata:2#p0,e,b"%WIN8DVDDIR%\boot\etfsboot.com"#pEF,e,b"%WIN8DVDDIR%\efi\microsoft\boot\efisys.bin" "%WIN8DVDDIR%" "%WIN8DVDISO%"
) else (
  "%KITPATH%\Deployment Tools\x86\Oscdimg\oscdimg.exe" -u1 -b"%WIN8DVDDIR%\boot\etfsboot.com" "%WIN8DVDDIR%" "%WIN8DVDISO%"
)
if errorlevel 1 goto E_CREATEISO

echo.
echo ==================================================================
echo Remove temporary directories
echo ==================================================================
echo.
if exist "%WIN8DVDDIR%" rmdir /s /q "%WIN8DVDDIR%"
if errorlevel 1 goto E_DELDIR
if exist "%TEMPDIR%" rmdir /s /q "%TEMPDIR%"
if errorlevel 1 goto E_DELDIR

goto DONE

:E_KITPATH
set MESSAGE=ERROR: Could not find the ADK directory!
goto END

:E_DELDIR
set MESSAGE=ERROR: Could not delete temporary directory!
goto END

:E_MKDIR
set MESSAGE=ERROR: Could not create temporary directory!
goto END

:E_LPFILE
set MESSAGE=ERROR: Could not find language pack!
goto END

:E_MOUNT
set MESSAGE=ERROR: Could not mount WIM image!
goto END

:E_UNMOUNT
set MESSAGE=ERROR: Could not unmount WIM image!
goto END

:E_CREATEISO
set MESSAGE=ERROR: Could not create "%WIN8DVDISO%"!
goto END

:DONE
cls
set MESSAGE=Done
goto END

:END
echo.
echo ==================================================================
echo %MESSAGE%
echo ==================================================================
echo.
pause
exit


Dieser Eintrag wurde am 28.12.2012 erstellt und zuletzt am 24.01.2016 bearbeitet.

Direkter Link zu dieser Seite: http://www.gtkdb.de/index_27_2032.html

[ Zur Startseite ]   [ Zur Kategorie ]


Valid XHTML 1.0 Transitional Valid CSS Valid Atom 1.0

© 2004-2018 by Georg Kainzbauer