No matter what I try for some reason I can't remove any package from my Windows 10 images. DISM gives me Error 5. Access is denied. install_wim_tweak appears like it works, but it's really just going through the motions because no packages are actually removed. I don't know why this is happening. I use an administrator account and UAC is disabled. SOLUTION: (taken from posts 11 and 15. credit to xinso) Spoiler Code: Dism /Mount-Image /ImageFile:<path to wim file> /index:<index #> /MountDir:<mount dir> install_wim_tweak.exe /p <mount dir> /l install_wim_tweak.exe /p <mount dir> for /d %%i in (ar-SA,bg-BG,cs-CZ,da-DK,de-DE,el-GR,en-GB,es-ES,et-EE,fi-FI,fr-FR,he-IL,hr-HR,hu-HU,it-IT,ja-JP,ko-KR,lt-LT,lv-LV,nb-NO,nl-NL,pl-PL,pt-BR,pt-PT,ro-RO,ru-RU,sk-SK,sl-SI,sr-Latn-RS,sv-SE,th-TH,tr-TR,uk-UA,zh-CN,zh-HK,zh-TW) do ( Dism /image:<mount dir> /remove-package ^ /packagename:Package-A~amd64~%%i~10.0.10586.0 ^ /packagename:Package-B~amd64~%%i~10.0.10586.0 ^ /packagename:Package-C~amd64~%%i~10.0.10586.0) install_wim_tweak.exe /h /p <mount dir> Dism /Unmount-Image /MountDir:<mount dir> /Commit dism /Export-Image /SourceImageFile:<path to source wim> /SourceIndex:<source index #> /DestinationImageFile:<path to save new wim> /compress:Max /CheckIntegrity Remember to change the red and blue text placeholders to your own files and paths.
are you using a windows 10 system to remove packages or running a Windows 8.1 or 7 ? You need the Winows 10 latest DISM.exe.
Win 10 DISM has worked fine for me in the past. I don't see why it should stop now. This feels more like a denial of permissions rather than a technical limitation.
How about: 1. Mount or Extract Windows 10 10586 x64 ISO to X:\10586 on Host Windows 7 x64 or Mount or Extract Windows 10 10586 x86 ISO to X:\10586 on Host Windows 7 x86 2. Extract install.wim and mount target image to Y:\MOUNT with Read&Write parameter 3. Run the script with Administrator privileges to unhide and get packages list (Packages.txt) Code: @echo off pushd "%~dp0" install_wim_tweak.exe /p Y:\MOUNT /l install_wim_tweak.exe /p Y:\MOUNT 4. Open Packages.txt, and run Command Prompt (Admin) 5. Run the commandline to remove target package(s) e.g. Adobe-Flash-For-Windows-Package~31bf3856ad364e35~amd64~~10.0.10586.0 Code: X:\10586\sources\dism /image:Y:\MOUNT /remove-package /packagename:Adobe-Flash-For-Windows-Package~31bf3856ad364e35~amd64~~10.0.10586.0 6. Run the script with Administrator privileges to hide packages Code: @echo off pushd "%~dp0" install_wim_tweak.exe /h /p Y:\MOUNT 7. Unmount/Commit the image [Note] 1. To remove a package, there is no need to remove the language package, the main package will remove it and all sub-packages automatically. But the language pack is needed if adding a package. 2. To deal with both x64 and x86 images, use x64 dism on x64 Host, and x86 dism on x86 Host.
I don't want to remove the main package, I just want to remove the language packages because there's a huge chunk of language packs I will never need. For example, these are all the packages for Microsoft-Media-Foundation-Package (there are more like this as well). I don't need all the language packs. I only need the en-us language pack and the main amd64 package. Spoiler Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~ar-SA~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~bg-BG~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~cs-CZ~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~da-DK~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~de-DE~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~el-GR~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~en-GB~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~en-US~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~es-ES~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~et-EE~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~fi-FI~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~fr-FR~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~he-IL~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~hr-HR~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~hu-HU~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~it-IT~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~ja-JP~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~ko-KR~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~lt-LT~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~lv-LV~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~nb-NO~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~nl-NL~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~pl-PL~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~pt-BR~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~pt-PT~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~qps-PLOCM~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~qps-PLOC~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~ro-RO~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~ru-RU~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~sk-SK~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~sl-SI~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~sr-LATN-RS~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~sv-SE~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~th-TH~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~tr-TR~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~uk-UA~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~zh-CN~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~zh-HK~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~zh-TW~10.0.10586.0 Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~~10.0.10586.0 How do I remove those packages?
Copy and make it a script, like Remove-Unwanted-Language.cmd. Then run it as Administrator at step 5. for /d %%i in (ar-SA,bg-BG,cs-CZ,da-DK,de-DE,el-GR,en-GB,es-ES,et-EE,fi-FI,fr-FR,he-IL,hr-HR,hu-HU,it-IT,ja-JP,ko-KR,lt-LT,lv-LV,nb-NO,nl-NL,pl-PL,pt-BR,pt-PT,ro-RO,ru-RU,sk-SK,sl-SI,sr-Latn-RS,sv-SE,th-TH,tr-TR,uk-UA,zh-CN,zh-HK,zh-TW) do (X:\10586\sources\dism /image:Y:\MOUNT /remove-package /packagename:Microsoft-Media-Foundation-Package~31bf3856ad364e35~amd64~%%i~10.0.10586.0)
I will try that and report back. For the other language packs in other packages I would just copy and paste the loop, but change the package name inside, right?
Yes. Or for /d %%i in (ar-SA,bg-BG,cs-CZ,da-DK,de-DE,el-GR,en-GB,es-ES,et-EE,fi-FI,fr-FR,he-IL,hr-HR,hu-HU,it-IT,ja-JP,ko-KR,lt-LT,lv-LV,nb-NO,nl-NL,pl-PL,pt-BR,pt-PT,ro-RO,ru-RU,sk-SK,sl-SI,sr-Latn-RS,sv-SE,th-TH,tr-TR,uk-UA,zh-CN,zh-HK,zh-TW) do ( X:\10586\sources\dism /image:Y:\MOUNT /remove-package ^ /packagename:Package-A~amd64~%%i~10.0.10586.0 ^ /packagename:Package-B~amd64~%%i~10.0.10586.0 ^ /packagename:Package-C~amd64~%%i~10.0.10586.0 ) pause
Providing the dism.log file would help determining the exact cause anyway, MediaFeaturePack is a permanent package, once added it can't be removed normally
Not needed. xinso's solution worked. The packages got removed according to the Packages.txt generated by install_wim_tweak. It doesn't matter to me that the MFP is a permanent package. Normally I'd be being using the standard Enterprise version, but that version downloads apps like Candy Crush, Twitter, etc. after the OOBE is complete. The N version does not and that's why I'm using it. The most interesting thing to come out this (I think) is that removing language packs actually added 60,766 extra kilobytes to the install.wim file size And @xinso: I've thanks'd the two posts that helped me.
Feedback@Get-Rid-of-5-Non-Default-Apps (CandyCrushSodaSaga, Twitter...) Use the 46 KB DefaultLayouts.xml of \Users\Default\AppData\Local\Microsoft\Windows\Shell for 10240 Enterprise LTSB instead of the 98 KB DefaultLayouts.xml for Non-LTSB editions Or the one for N versions. Export it to a new file. Code: dism /Export-Image /SourceImageFile:X:\old.wim /SourceIndex:1 /DestinationImageFile:X:\new.wim /compress:Max /CheckIntegrity
Okay. So just copy the .xml from that path on the LTSB version to the same on Enterprise and it won't download the bloatware? The extra ~60 MB was after rebuilding the image with max compression. That's why I thought it was interesting.