Dism'in 10

Discussion in 'Windows 10' started by spidernz, May 23, 2015.

  1. spidernz

    spidernz MDL Senior Member

    May 20, 2011
    276
    70
    10
    #1 spidernz, May 23, 2015
    Last edited by a moderator: Apr 20, 2017
    Hmm, i'm getting this error "An attempt was made to load a program with an incorrect format." when trying to mount the image, i'm not sure whats wrong

    Code:
    Pause
    @echo off
    Echo --------------------------------------------------------------------------------
    Echo Clearing Existing Directories and Recreating
    Echo --------------------------------------------------------------------------------
    
    Echo "Set Apps Drive Letter:"
    Set /P A=
    
    Echo "Set Working Directory Drive Letter:"
    Set /P WD=
    
    Echo "Set Driver Drive Letter:"
    Rem Set /P D=
    
    Set APPS=%A%:\Apps\GetWaikTools\Win10\amd64
    Set TWEAK=%A%:\Apps\GetWaikTools\install_wim_tweak.exe
    Set BUILD=%A%:\Windows Builder\Wmc Builder
    Rem Set DRIVERS=%D%:\Drivers\Current PCs\WHD Drivers
    Set DRIVERS=%A%:\Drivers
    
    DEL /F /Q "%WD%:\Win10\*.*"
    RD /S /Q  "%WD%:\Win10"
    DEL /F /Q "%BUILD%\Logs\*.*"
    RD /S /Q  "%BUILD%\Logs"
    DEL /F /Q "%BUILD%\10 Features\*.*"
    RD /S /Q  "%BUILD%\10 Features"
    
    MKDIR "%WD%:\Win10"
    Set PATH=%WD%:\Win10
    MKDIR "%PATH%\Iso"
    MKDIR "%PATH%\Mount"
    Set MOUNT=%PATH%\Mount
    MKDIR "%PATH%\Scratch"
    MKDIR "%PATH%\BootMount"
    MKDIR "%PATH%\Wim"
    MKDIR "%PATH%\BootWim"
    MKDIR "%BUILD%\Logs"
    MKDIR "%BUILD%\10 Features"
    
    "%APPS%\Dism\Dism.exe" /Cleanup-Mountpoints
    
    Echo --------------------------------------------------------------------------------
    Echo "Extracting Windows Iso & Moving Files"
    Echo --------------------------------------------------------------------------------
    "%APPS%\7z.exe" x -y -o"%PATH%\Iso" "I:\Win 10.122.iso">"%BUILD%\Logs\Extract.txt" 
    Rem Move "%PATH%\Iso\sources\install.wim" "%PATH%\Wim\"
    
    Echo --------------------------------------------------------------------------------
    Echo "Convert Esd"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /Get-wimInfo /wimFile:%PATH%\Iso\sources\install.esd
    "%APPS%\Dism\Dism.exe" /Export-Image /SourceImageFile:%PATH%\Iso\sources\install.esd /SourceIndex:1 /DestinationImageFile:%PATH%\Wim\install.wim /DestinationName:"Windows 10 Professional" /compress:recovery /CheckIntegrity
    
    
    Echo --------------------------------------------------------------------------------
    Echo "Mounting Image"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /mount-wim /wimfile:%PATH%\wim\install.wim  /index:1 /mountdir:%MOUNT%
    
    
    Echo --------------------------------------------------------------------------------
    Echo "Listing Packages/Apps"
    Echo --------------------------------------------------------------------------------
    rem "%TWEAK%" /p "%MOUNT%">"%BUILD%\8.1 Features\RegTweak-Pre-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Packages /Format:Table>"%BUILD%\10 Features\Packages-Pre-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Features /Format:Table>"%BUILD%\10 Features\Features-Pre-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-ProvisionedAppxPackages /Format:Table>"%BUILD%\10 Features\ProvisionedAppx-Pre-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Drivers>"%BUILD%\10 Features\Drivers-Pre-1.txt"
    
    Pause
    
    
    
    
    
     
  2. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    7,655
    24,541
    240
    The system image is index 4
     
  3. TS2008

    TS2008 MDL Novice

    Mar 24, 2015
    4
    2
    0
    I don't thing it's a good idea to use the PATH variable as your own variable for thus things, since PATH is a system environment variable.
     
  4. spidernz

    spidernz MDL Senior Member

    May 20, 2011
    276
    70
    10
    #4 spidernz, May 23, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
    It says index is 1 though when i Put ""%APPS%\Dism\Dism.exe" /Get-wimInfo /wimFile:%PATH%\wim\install.wim" line. prior to the mounting.

    Ok so the dism log says [i:\Win10\Mount] is not a WIM mount point

    dism log:
    Code:
    
    2015-05-24 01:13:36, Info                  DISM   DISM Provider Store: PID=4252 TID=3224 Getting the collection of providers from a local provider store type. - CDISMProviderStore::GetProviderCollection
    [4252] [0x80070002] FIOReadFileIntoBuffer:(1250): The system cannot find the file specified.
    [4252] [0xc142011c] UnmarshallImageHandleFromDirectory:(778)
    [4252] [0xc142011c] WIMGetMountedImageHandle:(2887)
    2015-05-24 01:13:36, Info                  DISM   DISM WIM Provider: PID=4252 TID=3224 [i:\Win10\Mount] is not a WIM mount point. - CWimMountedImageInfo::Initialize
    2015-05-24 01:13:36, Info                  DISM   DISM VHD Provider: PID=4252 TID=3224 [i:\Win10\Mount] is not recognized by the DISM VHD provider. - CVhdImage::Initialize
    2015-05-24 01:13:36, Info                  DISM   DISM Provider Store: PID=4252 TID=3224 Getting Provider VHDManager - CDISMProviderStore::GetProvider
    2015-05-24 01:13:36, Info                  DISM   DISM Provider Store: PID=4252 TID=3224 Provider has previously been initialized.  Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
    2015-05-24 01:13:36, Info                  DISM   DISM VHD Provider: PID=4252 TID=3224 [i:\Win10\Mount] is not recognized by the DISM VHD provider. - CVhdImage::Initialize
    2015-05-24 01:13:36, Info                  DISM   DISM Imaging Provider: PID=4252 TID=3224 The provider VHDManager does not support CreateDismImage on i:\Win10\Mount - CGenericImagingManager::CreateDismImage
    2015-05-24 01:13:36, Info                  DISM   DISM Provider Store: PID=4252 TID=3224 Getting Provider WimManager - CDISMProviderStore::GetProvider
    2015-05-24 01:13:36, Info                  DISM   DISM Provider Store: PID=4252 TID=3224 Provider has previously been initialized.  Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
    [4252] [0x80070002] FIOReadFileIntoBuffer:(1250): The system cannot find the file specified.
    [4252] [0xc142011c] UnmarshallImageHandleFromDirectory:(778)
    [4252] [0xc142011c] WIMGetMountedImageHandle:(2887)
    2015-05-24 01:13:36, Info                  DISM   DISM WIM Provider: PID=4252 TID=3224 [i:\Win10\Mount] is not a WIM mount point. - CWimMountedImageInfo::Initialize
    2015-05-24 01:13:36, Info                  DISM   DISM Imaging Provider: PID=4252 TID=3224 The provider WimManager does not support CreateDismImage on i:\Win10\Mount - CGenericImagingManager::CreateDismImage
    2015-05-24 01:13:36, Info                  DISM   DISM Imaging Provider: PID=4252 TID=3224 No imaging provider supported CreateDismImage for this path - CGenericImagingManager::CreateDismImage
    2015-05-24 01:13:36, Error                 DISM   DISM.EXE: Failed to access the image folder or image's windows folder.
    2015-05-24 01:13:36, Info                  DISM   DISM.EXE: Image session has been closed. Reboot required=no.
    2015-05-24 01:13:36, Info                  DISM   DISM.EXE: 
    2015-05-24 01:13:36, Info                  DISM   DISM.EXE: <----- Ending Dism.exe session ----->
    

    @TS2008, hmm, noted. Thanks
     
  5. Shenj

    Shenj MDL Expert

    Aug 12, 2010
    1,557
    652
    60
    #5 Shenj, May 24, 2015
    Last edited: May 24, 2015
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. xinso

    xinso MDL Guru

    Mar 5, 2009
    4,449
    5,579
    150
    #6 xinso, May 24, 2015
    Last edited by a moderator: Apr 20, 2017
    "%APPS%\Dism\Dism.exe" /Export-Image /SourceImageFile:%PATH%\Iso\sources\install.esd /SourceIndex:1 /DestinationImageFile:%PATH%\Wim\install.wim /DestinationName:"Windows 10 Professional" /compress:recovery /CheckIntegrity

    NOT possible to mount an image compressed with recovery parameter (atm even 10122)

    Code:
    C:\windows\system32>Dism.exe /mount-wim /wimfile:E:\install.esd /index:1 /mountdir:E:\MOUNT
    
    Deployment Image Servicing and Management tool
    Version: 10.0.10122.0
    
    Error: 11
    
    An attempt was made to load a program with an incorrect format.
    
    The DISM log file can be found at C:\windows\Logs\DISM\dism.log
    
    Use /compress:max instead
     
  7. spidernz

    spidernz MDL Senior Member

    May 20, 2011
    276
    70
    10
    Ah yes that worked, thanks xinso

    @Shenj cool will have a look into it.
     
  8. spidernz

    spidernz MDL Senior Member

    May 20, 2011
    276
    70
    10
    #8 spidernz, May 28, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
    So was playing some more, i broke the tiles preview somehow :confused:

    Win10.png



    Code:
    Rem  ".NET 3.5 (include .NET 2.0 and 3.0) & .NET 4.5.1 Enabler + Excess Package Remover Updated 16/05/2015"
    Rem  "Make Sure Running As Administrator"
    
    Pause
    @echo off
    Echo --------------------------------------------------------------------------------
    Echo Clearing Existing Directories and Recreating
    Echo --------------------------------------------------------------------------------
    
    Echo "Set Apps Drive Letter:"
    Set /P A=
    
    Echo "Set Working Directory Drive Letter:"
    Set /P WD=
    
    Echo "Set Driver Drive Letter:"
    Rem Set /P D=
    
    Set APPS=%A%:\Apps\GetWaikTools\Win10\amd64
    Set TWEAK=%A%:\Apps\GetWaikTools\install_wim_tweak.exe
    Set BUILD=%A%:\Windows Builder\Wmc Builder
    Rem Set DRIVERS=%D%:\Drivers\Current PCs\WHD Drivers
    Set DRIVERS=%A%:\Drivers
    
    DEL /F /Q "%WD%:\Win10\*.*"
    RD /S /Q  "%WD%:\Win10"
    DEL /F /Q "%BUILD%\Logs\*.*"
    RD /S /Q  "%BUILD%\Logs"
    DEL /F /Q "%BUILD%\10 Features\*.*"
    RD /S /Q  "%BUILD%\10 Features"
    DEL /F /Q "C:\Windows\Logs\DISM\*.*"
    
    MKDIR "%WD%:\Win10"
    Set DIREC=%WD%:\Win10
    MKDIR "%DIREC%\Iso"
    MKDIR "%DIREC%\Mount"
    Set MOUNT=%DIREC%\Mount
    MKDIR "%DIREC%\Scratch"
    MKDIR "%DIREC%\BootMount"
    MKDIR "%DIREC%\Wim"
    MKDIR "%DIREC%\BootWim"
    MKDIR "%BUILD%\Logs"
    MKDIR "%BUILD%\10 Features"
    
    "%APPS%\Dism\Dism.exe" /Cleanup-Mountpoints
    
    Echo --------------------------------------------------------------------------------
    Echo "Extracting Windows Iso & Moving Files"
    Echo --------------------------------------------------------------------------------
    "%APPS%\7z.exe" x -y -o"%DIREC%\Iso" "I:\Win 10.125.iso">"%BUILD%\Logs\Extract.txt" 
    
    
    Echo --------------------------------------------------------------------------------
    Echo "Convert Esd"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /Get-wimInfo /wimFile:%DIREC%\Iso\sources\install.esd
    "%APPS%\Dism\Dism.exe" /Export-Image /SourceImageFile:%DIREC%\Iso\sources\install.esd /SourceIndex:1 /DestinationImageFile:%DIREC%\Wim\install.wim /DestinationName:"Windows 10 Professional" /compress:max /CheckIntegrity
    
    Echo --------------------------------------------------------------------------------
    Echo "Move Wim File"
    Echo --------------------------------------------------------------------------------
    Move "%DIREC%\Iso\sources\install.wim" "%DIREC%\Wim\"
    
    Echo --------------------------------------------------------------------------------
    Echo "Mounting Image"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /Get-wimInfo /wimFile:%DIREC%\wim\install.wim
    "%APPS%\Dism\Dism.exe" /mount-wim /wimfile:%DIREC%\wim\install.wim  /index:1 /mountdir:%MOUNT%
    
    
    Echo --------------------------------------------------------------------------------
    Echo "Injecting Custom files"
    Echo --------------------------------------------------------------------------------
    xcopy  /s /h /y /k /g /c "%BUILD%\Files\Hosts\Hosts" "%MOUNT%\Windows\System32\drivers\etc\"
    xcopy  /s /h /y /k /g /c "%BUILD%\Files\Integrate\FileExt_Toggle.vbs" "%MOUNT%\Windows\System"
    xcopy  /s /h /y /k /g /c "%BUILD%\Files\Integrate\HiddenFiles_Toggle.vbs" "%MOUNT%\Windows\System"
    xcopy  /s /h /y /k /g /c "%BUILD%\Files\Integrate\Blank_Shortcut_Arrow.ico" "%MOUNT%\Windows\System"
    xcopy  /s /h /y /k /g /c "%BUILD%\Files\Integrate\Notepad2.exe" "%MOUNT%\Windows\System"
    xcopy  /s /h /y /k /g /c "%BUILD%\Files\Integrate\Notepad2.ini" "%MOUNT%\Windows\System"
    
    Echo --------------------------------------------------------------------------------
    Echo "Deleting and Updating Pictures/Themes"
    Echo --------------------------------------------------------------------------------
    Takeown /F "%MOUNT%\Windows\Web\Screen\img100.jpg"
    Icacls "%MOUNT%\Windows\Web\Screen\img100.jpg" /grant administrators:F
    Takeown /F "%MOUNT%\Windows\Web\Screen\*.jpg"
    Icacls "%MOUNT%\Windows\Web\Screen\*.jpg" /grant administrators:F
    Takeown /F "%MOUNT%\Windows\Web\Wallpaper\Windows\img0.jpg"
    Icacls "%MOUNT%\Windows\Web\Wallpaper\Windows\img0.jpg" /grant administrators:F
    Takeown /F "%MOUNT%\Windows\Web\Wallpaper\Theme1\*.jpg"
    Icacls "%MOUNT%\Windows\Web\Wallpaper\Theme1\*.jpg" /grant administrators:F
    Takeown /F "%MOUNT%\Windows\Web\Wallpaper\Theme2\*.jpg"
    Icacls "%MOUNT%\Windows\Web\Wallpaper\Theme2\*.jpg" /grant administrators:F
    Takeown /F "%MOUNT%\Windows\Resources\Ease of Access Themes\*.theme"
    Icacls "%MOUNT%\Windows\Resources\Ease of Access Themes\*.theme" /grant administrators:F
    Takeown /F "%MOUNT%\Windows\Resources\Themes\*.theme"
    Icacls "%MOUNT%\Windows\Resources\Themes\*.theme" /grant administrators:F
    
    Del /F /Q "%MOUNT%\Windows\Web\Screen\*.*"
    Del /F /Q "%MOUNT%\Windows\Web\Wallpaper\Theme1\*.*"
    RD /S /Q "%MOUNT%\Windows\Web\Wallpaper\Theme1"
    Del /F /Q "%MOUNT%\Windows\Web\Wallpaper\Theme2\*.*"
    RD /S /Q "%MOUNT%\Windows\Web\Wallpaper\Theme2"
    Del /F /Q "%MOUNT%\Windows\Web\Wallpaper\Windows\*.*"
    Del /F /Q "%MOUNT%\Windows\Resources\Themes\*.*"
    Del /F /Q "%MOUNT%\Windows\Resources\Ease of Access Themes\*.*"
    RD /S /Q "%MOUNT%\Windows\Resources\Ease of Access Themes"
    
    Del /F /Q %MOUNT%\ProgramData\Microsoft\User Account Pictures\Default Pictures\*.bmp
    Del /F /Q %MOUNT%\ProgramData\Microsoft\User Account Pictures\Default Pictures\*.png
    RD /S /Q %MOUNT%\ProgramData\Microsoft\User Account Pictures\Default Pictures
    Del /F /Q %MOUNT%\ProgramData\Microsoft\User Account Pictures\*.bmp
    Del /F /Q %MOUNT%\ProgramData\Microsoft\User Account Pictures\*.png
    
    xcopy  /h /y /k /g /c "%BUILD%\Files\Images\img100.jpg" "%MOUNT%\Windows\Web\Screen\"
    xcopy  /h /y /k /g /c "%BUILD%\Files\Images\img0.jpg" "%MOUNT%\Windows\Web\Wallpaper\Windows"
    xcopy  /h /y /k /g /c "%BUILD%\Files\Images\Guest.bmp" "%MOUNT%\ProgramData\Microsoft\User Account Pictures"
    xcopy  /h /y /k /g /c "%BUILD%\Files\Images\Guest.png" "%MOUNT%\ProgramData\Microsoft\User Account Pictures"
    xcopy  /h /y /k /g /c "%BUILD%\Files\Images\User.bmp" "%MOUNT%\ProgramData\Microsoft\User Account Pictures"
    xcopy  /h /y /k /g /c "%BUILD%\Files\Images\User.png" "%MOUNT%\ProgramData\Microsoft\User Account Pictures"
    xcopy  /h /y /k /g /c "%BUILD%\Files\Images\User-200.png" "%MOUNT%\ProgramData\Microsoft\User Account Pictures"
    xcopy  /h /y /k /g /c "%BUILD%\Files\Images\User-40.png" "%MOUNT%\ProgramData\Microsoft\User Account Pictures"
    
    Echo --------------------------------------------------------------------------------
    Echo "Deleting Support folder"
    Echo --------------------------------------------------------------------------------
    DEL /F /Q "%PATH%\iso\Support\*.*"
    RD /S /Q  "%PATH%\iso\Support"
    
    Echo --------------------------------------------------------------------------------
    Echo "Setting Up Windows Edition"
    Echo --------------------------------------------------------------------------------
    Rem "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Set-ProductKey:
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Set-UILang:en-NZ
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Set-UILangFallback:en-US
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Set-Syslocale:en-NZ
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Set-UserLocale:en-NZ
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Set-InputLocale:1409:00000409
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Set-TimeZone:"New Zealand Standard Time"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Intl
    
    Echo --------------------------------------------------------------------------------
    Echo "Enabling .NET 3.5 (include .NET 2.0 and 3.0)"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /image:%MOUNT% /Enable-Feature /FeatureName:NetFx3 /All /Source:%PATH%\Iso\sources\sxs /LimitAccess
    
    Echo --------------------------------------------------------------------------------
    Echo "Integrating Drivers"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /ScratchDir:%PATH%\Scratch /Add-Driver /Driver:"%DRIVERS%" /Recurse /Forceunsigned>"%BUILD%\Logs\Drivers.txt"
    "%APPS%\Dism\Dism.exe" /Commit-Image  /mountdir:%MOUNT%
    
    Echo --------------------------------------------------------------------------------
    Echo "Listing Packages/Apps"
    Echo --------------------------------------------------------------------------------
    rem "%TWEAK%" /p "%MOUNT%">"%BUILD%\8.1 Features\RegTweak-Pre-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Packages /Format:Table>"%BUILD%\10 Features\Packages-Pre-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Features /Format:Table>"%BUILD%\10 Features\Features-Pre-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-ProvisionedAppxPackages /Format:Table>"%BUILD%\10 Features\ProvisionedAppx-Pre-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Drivers>"%BUILD%\10 Features\Drivers-Pre-1.txt"
    
    Echo --------------------------------------------------------------------------------
    Echo "Removing Uneeded Apps"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneVideo_2019.6.9991.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneMusic_2019.6.9991.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxApp_4.4.21012.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsSoundRecorder_2015.511.1505.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsScan_2014.523.326.3026_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsReadingList_2014.626.1418.1617_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsMaps_2015.514.146.2700_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsCommunicationsapps_2015.4103.42251.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsCamera_2015.507.844.3365_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsCalculator_2015.512.1505.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsAlarms_2015.507.1505.0_neutral_~_8wekyb3d8bbwe
    rem "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxLIVEGames_2013.1011.10.5965_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Windows.Photos_2015.509.148.501_neutral_~_8wekyb3d8bbwe
    rem "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Reader_2014.1127.441.2757_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.People_2015.517.851.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Office.OneNote_2015.505.2239.1056_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftSolitaireCollection_2015.506.10.3053_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Getstarted_2015.418.3.4415_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingWeather_2015.0.532.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingSports_2015.0.532.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingNews_2015.0.532.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingFinance_2015.0.532.0_neutral_~_8wekyb3d8bbwe
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.3DBuilder_2015.506.2100.4776_neutral_~_8wekyb3d8bbwe
    rem "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ConnectivityStore_2015.507.123.0_neutral_~_8wekyb3d8bbwe
    
    Echo --------------------------------------------------------------------------------
    Echo "Removing Uneeded Packages"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-TextToSpeech-en-us-Package~31bf3856ad364e35~amd64~~10.0.10125.0
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Speech-en-us-Package~31bf3856ad364e35~amd64~~10.0.10125.0
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-Package /PackageName:Microsoft-Windows-RetailDemo-OfflineContent-Content-Package~31bf3856ad364e35~amd64~~10.0.10125.0  
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Remove-Package /PackageName:Microsoft-Windows-RetailDemo-OfflineContent-Content-en-us-Package~31bf3856ad364e35~amd64~~10.0.10125.0 
    
    Echo --------------------------------------------------------------------------------
    Echo "Disabling And Removing Excess Features"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Disable-Feature /FeatureName:Microsoft-Hyper-V-Hypervisor /FeatureName:Microsoft-Hyper-V-Services /FeatureName:Microsoft-Hyper-V /FeatureName:Microsoft-Hyper-V-Tools-All /FeatureName:Microsoft-Hyper-V-All /FeatureName:Microsoft-Hyper-V-Management-Clients /FeatureName:Microsoft-Hyper-V-Management-PowerShell /FeatureName:Printing-Foundation-LPRPortMonitor /FeatureName:Printing-Foundation-LPDPrintService /FeatureName:Printing-Foundation-InternetPrinting-Client /FeatureName:ScanManagementConsole /FeatureName:SimpleTCP /FeatureName:SNMP /FeatureName:WMISnmpProvider /FeatureName:Windows-Identity-Foundation /FeatureName:MicrosoftWindowsPowerShellV2Root /FeatureName:MicrosoftWindowsPowerShellV2 /FeatureName:DirectoryServices-ADAM-Client /FeatureName:Internet-Explorer-Optional-amd64 /FeatureName:IIS-WebServerRole /FeatureName:IIS-WebServer /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-HttpErrors /FeatureName:IIS-HttpRedirect /FeatureName:IIS-ApplicationDevelopment  /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-NetFxExtensibility45 /FeatureName:IIS-HealthAndDiagnostics /FeatureName:IIS-HttpLogging /FeatureName:IIS-LoggingLibraries /FeatureName:IIS-RequestMonitor /FeatureName:IIS-HttpTracing /FeatureName:IIS-Security /FeatureName:IIS-URLAuthorization /FeatureName:IIS-RequestFiltering /FeatureName:IIS-IPSecurity /FeatureName:IIS-Performance /FeatureName:IIS-HttpCompressionDynamic /FeatureName:IIS-WebServerManagementTools /FeatureName:IIS-ManagementScriptingTools /FeatureName:IIS-IIS6ManagementCompatibility /FeatureName:IIS-Metabase /FeatureName:WAS-WindowsActivationService /FeatureName:WAS-ProcessModel /FeatureName:WAS-NetFxEnvironment /FeatureName:WAS-ConfigurationAPI /FeatureName:IIS-HostableWebCore /FeatureName:IIS-CertProvider /FeatureName:IIS-WindowsAuthentication /FeatureName:IIS-DigestAuthentication /FeatureName:IIS-ClientCertificateMappingAuthentication /FeatureName:IIS-IISCertificateMappingAuthentication /FeatureName:IIS-ODBCLogging /FeatureName:IIS-StaticContent /FeatureName:IIS-DefaultDocument /FeatureName:IIS-DirectoryBrowsing /FeatureName:IIS-WebDAV /FeatureName:IIS-WebSockets /FeatureName:IIS-ApplicationInit /FeatureName:IIS-ASPNET /FeatureName:IIS-ASPNET45 /FeatureName:IIS-ASP /FeatureName:IIS-CGI /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-ServerSideIncludes /FeatureName:IIS-CustomLogging /FeatureName:IIS-BasicAuthentication /FeatureName:IIS-HttpCompressionStatic /FeatureName:IIS-ManagementConsole /FeatureName:IIS-ManagementService /FeatureName:IIS-WMICompatibility /FeatureName:IIS-LegacyScripts /FeatureName:IIS-LegacySnapIn /FeatureName:IIS-FTPServer /FeatureName:IIS-FTPSvc /FeatureName:IIS-FTPExtensibility /FeatureName:MSMQ-Container /FeatureName:MSMQ-Server /FeatureName:MSMQ-Triggers /FeatureName:MSMQ-ADIntegration /FeatureName:MSMQ-HTTP /FeatureName:MSMQ-Multicast /FeatureName:MSMQ-DCOMProxy /FeatureName:WCF-Services45 /FeatureName:WCF-HTTP-Activation45 /FeatureName:WCF-TCP-Activation45 /FeatureName:WCF-Pipe-Activation45 /FeatureName:WCF-MSMQ-Activation45 /FeatureName:WCF-TCP-PortSharing45 /FeatureName:WCF-HTTP-Activation /FeatureName:WCF-NonHTTP-Activation /FeatureName:NetFx4-AdvSrvs /FeatureName:NetFx4Extended-ASPNET45 /FeatureName:RasCMAK /FeatureName:RasRip /FeatureName:TelnetClient /FeatureName:TFTP /FeatureName:TIFFIFilter /FeatureName:MSRDC-Infrastructure /FeatureName:Printing-XPSServices-Features /FeatureName:SMB1Protocol /FeatureName:WorkFolders-Client /FeatureName:SearchEngine-Client-Package /FeatureName:LegacyComponents /Remove >>"%BUILD%\Logs\RemoveFeatures.txt"
    
    Rem /FeatureName:TelnetServer /FeatureName:Microsoft-Windows-MobilePC-Client-Premium-Package-net /FeatureName:Microsoft-Windows-MobilePC-LocationProvider-INF /FeatureName:Windows-Defender-Default-Definitions 
    
    Pause
    
    Echo --------------------------------------------------------------------------------
    Echo "Disabling And Removing RSAT"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Disable-Feature /FeatureName:RemoteServerAdministrationTools /FeatureName:RemoteServerAdministrationTools-ServerManager /FeatureName:RemoteServerAdministrationTools-Roles /FeatureName:RemoteServerAdministrationTools-Roles-CertificateServices /FeatureName:RemoteServerAdministrationTools-Roles-CertificateServices-CA /FeatureName:RemoteServerAdministrationTools-Roles-CertificateServices-OnlineResponder /FeatureName:RemoteServerAdministrationTools-Roles-AD /FeatureName:RemoteServerAdministrationTools-Roles-AD-DS /FeatureName:RemoteServerAdministrationTools-Roles-AD-DS-SnapIns /FeatureName:RemoteServerAdministrationTools-Roles-AD-DS-AdministrativeCenter /FeatureName:RemoteServerAdministrationTools-Roles-AD-DS-NIS /FeatureName:RemoteServerAdministrationTools-Roles-AD-Powershell /FeatureName:RemoteServerAdministrationTools-Roles-DHCP /FeatureName:RemoteServerAdministrationTools-Roles-DNS /FeatureName:RemoteServerAdministrationTools-Roles-RemoteAccess /FeatureName:RemoteServerAdministrationTools-Roles-FileServices /FeatureName:RemoteServerAdministrationTools-Roles-FileServices-Dfs /FeatureName:RemoteServerAdministrationTools-Roles-FileServices-Fsrm /FeatureName:RemoteServerAdministrationTools-Roles-FileServices-Nfs /FeatureName:RemoteServerAdministrationTools-Roles-FileServices-StorageMgmt /FeatureName:RemoteServerAdministrationTools-Roles-RDS /FeatureName:RemoteServerAdministrationTools-Roles-RDS-Gateway /FeatureName:RemoteServerAdministrationTools-Roles-RDS-LicensingUI /FeatureName:RemoteServerAdministrationTools-Roles-RDS-LicensingDiagUI /FeatureName:RemoteServerAdministrationTools-Roles-VA /FeatureName:RemoteServerAdministrationTools-Roles-WSUS /FeatureName:RemoteServerAdministrationTools-Roles-WSUS-API /FeatureName:RemoteServerAdministrationTools-Roles-WSUS-UI /FeatureName:RemoteServerAdministrationTools-Features /FeatureName:RemoteServerAdministrationTools-Features-BitLocker /FeatureName:RemoteServerAdministrationTools-Features-Clustering /FeatureName:RemoteServerAdministrationTools-Features-GP /FeatureName:RemoteServerAdministrationTools-Features-IPAM /FeatureName:RemoteServerAdministrationTools-Features-LoadBalancing /FeatureName:RemoteServerAdministrationTools-Features-NICTeaming /Remove >>"%BUILD%\Logs\RemoveRSat.txt"
    "%APPS%\Dism\Dism.exe" /unmount-wim /mountdir:%MOUNT% /commit
    
    Echo --------------------------------------------------------------------------------
    Echo "Mounting Image"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /mount-wim /wimfile:%DIREC%\wim\install.wim /index:1 /mountdir:%MOUNT%
    
    Echo --------------------------------------------------------------------------------
    Echo "Listing Packages/Apps"
    Echo --------------------------------------------------------------------------------
    rem "%TWEAK%" /p "%MOUNT%">"%BUILD%\10 Features\RegTweak-Post-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Packages /Format:Table>"%BUILD%\10 Features\Packages-Post-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Features /Format:Table>"%BUILD%\10 Features\Features-Post-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-ProvisionedAppxPackages /Format:Table>"%BUILD%\10 Features\ProvisionedAppx-Post-1.txt"
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Drivers>"%BUILD%\10 Features\Drivers-Post-1.txt"
    
     
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Cleanup-Image /AnalyzeComponentStore
    "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Cleanup-Image
    "%APPS%\Dism\Dism.exe" /Commit-Image /mountdir:%MOUNT%
    rem "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Cleanup-Image /StartComponentCleanup /ResetBase
    rem "%APPS%\Dism\Dism.exe" /Commit-Image  /mountdir:%MOUNT%
    
    Echo --------------------------------------------------------------------------------
    Echo "Commiting, Saving And Unmounting Image"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /unmount-wim /mountdir:%MOUNT% /commit
    "%APPS%\imagex.exe" /flags "Professional" /info %DIREC%\wim\install.wim 1 "Windows 10 Pro" "Windows 10 Pro"
    "%APPS%\Dism\Dism.exe" /Export-Image /SourceImageFile:%DIREC%\wim\install.wim /SourceIndex:1 /DestinationImageFile:%DIREC%\iso\sources\install.wim /compress:max
    
    Echo --------------------------------------------------------------------------------
    Echo "Building Iso..."
    Echo --------------------------------------------------------------------------------
    "%APPS%\oscdimg.exe" -h -m -o -u2 -udfver102 -bootdata:2#p0,e,b%DIREC%\iso\boot\etfsboot.com#pEF,e,b%DIREC%\iso\efi\microsoft\boot\efisys.bin -lWindows-10-Pro-Vanilla %DIREC%\iso "%WD%:\Windows 10 Pro Vanilla v1.0.iso"
    
    Echo --------------------------------------------------------------------------------
    Echo "Modification Complete"
    Pause
    Echo "Cleanup And Exit"
    Echo --------------------------------------------------------------------------------
    "%APPS%\Dism\Dism.exe" /Cleanup-Mountpoints
    DEL /F /Q "%DIREC%\*.*"
    RD /S /Q  "%DIREC%"
    Exit
    
     

    Attached Files:

  9. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    7,655
    24,541
    240
    You are removing all that and expect the edition to be functioning normally? :D

    removing PowerShell is a bad idea, many system features rely on it