Copy the required entries from the template into the RemovePkgsList.txt and use the [4] Remove -> [4] Remove Windows Components using Package List menu.
The slowness is due to the code protection I have added to ToolKitHelper program which needs to loaded into the memory and decoded, then executes the program, so each time the ToolKitHelper is called it repeats the process. I'm planning to add the support for accepting more than one component names for the ToolKitHelper so that it will speed up the process. Removal of Font, Keyboard layouts and languages is a huge list, will try to add them in future releases.
They don't already exist, I do create them, Hyper-V is huge package and is connected with may other components, may be one day it will be added.
The reason for delay I have already specified before, no matter you use the menu or the list the delay will be there, but if you use the category name instead of all the components in the category it will less time.
Do check in boot.wim->sources folder if it exists, I may do need more time to see what's it needs to fix it.
Yes I'm creating the packs but having issues with Edge Chromium for Windows 7 x64 although the Windows 7 x86 pack works. Will update once all the packs are ready.
10.0.19041.264 x64 Windows 10 Enterprise 17763.1282 x64 Windows 10 1809 LTSC if you not delete system restore, both have a system restore bug (no menu, if use command line it says spp.dll error) integration calculator have a bug (after integration updates, updates are replace mui in System32 and SysWOW64) so to work calculator again need to replace mui to previous version from calc folder.
May be File History component might be causing the issue with System Restore since it share few files with System Restore, will check about that. Don't Integrate Win32Calc pack to LTSC since it already contains the Win32 Calculator. Will check for other versions/editions, may be moving the Win32Callc to Program Files will be a better idea.
MSMG, I have a problem with removing Cortana, the context menu on the "Show Cortana Button" taskbar and the Cortana page in OOBE are not deleted. The OOBE Cortana page I saw only in a virtual machine. What images need to be mounted, did I mount only install.wim? I also tried to mount all the images, but nothing has changed. Is this a problem only with me or is it well-known? p,s I am using the latest release build 2004.
Is there a way, without having to repeat the command for each App to be removed, to make the code perform the command "call: RemoveWindowsComponents" and list the apps to be removed at once? Maybe perform the removal by calling powershell to remove apps with a command like this: File name: "cmd_call-PSscripts.cmd" there are 2 possibilities Code: @echo off &title cmd_call-PSscripts.cmd PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList 'Set-ExecutionPolicy Unrestricted -Force' -Verb RunAs}" PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Unrestricted "(%~dp0remove-CustomSelected_DefaultApps.ps1)"' -Verb RunAs}" Code: @echo off &title cmd_call-PSscripts.cmd ::========================================== :: Getting Admin Rights fltmc >nul 2>&1 || ( cd /d "%~dp0" cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~dp0"" && ""%~dpnx0"" ""%_Args%""", "", "runas", 1 > "%temp%\GetAdmin.vbs" "%temp%\GetAdmin.vbs">"%temp%\GetAdminUnicode.vbs" cscript //nologo "%temp%\GetAdminUnicode.vbs" del /f /q "%temp%\GetAdmin.vbs" >nul 2>&1 del /f /q "%temp%\GetAdminUnicode.vbs" >nul 2>&1 exit ) PowerShell.exe -NoProfile Set-ExecutionPolicy Unrestricted -Force PowerShell.exe -NoProfile -ExecutionPolicy Unrestricted -command "& {%~dp0remove-CustomSelected_DefaultApps.ps1}" File name: "remove-CustomSelected_DefaultApps.ps1" Code: # Description: # This script removes unwanted Apps that come with Windows. If you do not want # to remove certain Apps comment out the corresponding lines below. Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 Write-Output "Elevating privileges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) Write-Output "Uninstalling default apps" $apps = @( # default Windows 10 apps # Vibranium apps "Microsoft.549981C3F5F10" #Cortana App #"Microsoft.Windows.Search_cw5n1h2txyewy" #Search App # Vanadium apps #"Microsoft.3DBuilder" #"Microsoft.Appconnector" "Microsoft.BingFinance" "Microsoft.BingNews" "Microsoft.BingSports" "Microsoft.BingTranslator" "Microsoft.BingWeather" #"Microsoft.FreshPaint" #"Microsoft.GamingServices" #"Microsoft.Microsoft3DViewer" "Microsoft.MicrosoftOfficeHub" "Microsoft.MicrosoftPowerBIForWindows" #"Microsoft.MicrosoftSolitaireCollection" #"Microsoft.MicrosoftStickyNotes" "Microsoft.MinecraftUWP" "Microsoft.NetworkSpeedTest" #"Microsoft.Office.OneNote" "Microsoft.OneConnect" "Microsoft.People" #"Microsoft.Print3D" "Microsoft.SkypeApp" "Microsoft.Wallet" #"Microsoft.Windows.Photos" #"Microsoft.WindowsAlarms" #"Microsoft.WindowsCalculator" #"Microsoft.WindowsCamera" "microsoft.windowscommunicationsapps" "Microsoft.WindowsMaps" "Microsoft.WindowsPhone" #"Microsoft.WindowsSoundRecorder" #"Microsoft.WindowsStore" # can't be re-installed #"Microsoft.Xbox.TCUI" #"Microsoft.XboxApp" #"Microsoft.XboxGameOverlay" #"Microsoft.XboxGamingOverlay" #"Microsoft.XboxSpeechToTextOverlay" "Microsoft.YourPhone" "Microsoft.ZuneMusic" "Microsoft.ZuneVideo" # Threshold 2 apps "Microsoft.CommsPhone" #"Microsoft.ConnectivityStore" "Microsoft.GetHelp" "Microsoft.Getstarted" "Microsoft.Messaging" "Microsoft.Office.Sway" #"Microsoft.OneConnect" "Microsoft.WindowsFeedbackHub" # Creators Update apps #"Microsoft.Microsoft3DViewer" #"Microsoft.MSPaint" #Redstone apps "Microsoft.BingFoodAndDrink" "Microsoft.BingHealthAndFitness" "Microsoft.BingTravel" "Microsoft.WindowsReadingList" # Redstone 5 apps #"Microsoft.MixedReality.Portal" #"Microsoft.ScreenSketch" #"Microsoft.XboxGamingOverlay" "Microsoft.YourPhone" # non-Microsoft "2FE3CB00.PicsArt-PhotoStudio" "46928bounde.EclipseManager" "4DF9E0F8.Netflix" "613EBCEA.PolarrPhotoEditorAcademicEdition" "6Wunderkinder.Wunderlist" "7EE7776C.LinkedInforWindows" "89006A2E.AutodeskSketchBook" "9E2F88E3.Twitter" "A278AB0D.DisneyMagicKingdoms" "A278AB0D.MarchofEmpires" "ActiproSoftwareLLC.562882FEEB491" # next one is for the Code Writer from Actipro Software LLC "CAF9E577.Plex" "ClearChannelRadioDigital.iHeartRadio" "D52A8D61.FarmVille2CountryEscape" "D5EA27B7.Duolingo-LearnLanguagesforFree" "DB6EA5DB.CyberLinkMediaSuiteEssentials" "DolbyLaboratories.DolbyAccess" "DolbyLaboratories.DolbyAccess" "Drawboard.DrawboardPDF" "Facebook.Facebook" "Fitbit.FitbitCoach" "Flipboard.Flipboard" "GAMELOFTSA.Asphalt8Airborne" "KeeperSecurityInc.Keeper" "Microsoft.BingNews" "NORDCURRENT.COOKINGFEVER" "PandoraMediaInc.29680B314EFC2" "Playtika.CaesarsSlotsFreeCasino" "ShazamEntertainmentLtd.Shazam" "SlingTVLLC.SlingTV" "SpotifyAB.SpotifyMusic" "TheNewYorkTimes.NYTCrossword" "ThumbmunkeysLtd.PhototasticCollage" "TuneIn.TuneInRadio" "WinZipComputing.WinZipUniversal" "XINGAG.XING" "flaregamesGmbH.RoyalRevolt2" "king.com.*" "king.com.BubbleWitch3Saga" "king.com.CandyCrushSaga" "king.com.CandyCrushSodaSaga" # apps which cannot be removed using Remove-AppxPackage #"Microsoft.BioEnrollment" #"Microsoft.MicrosoftEdge" #"Microsoft.Windows.Cortana" #"Microsoft.WindowsFeedback" #"Microsoft.XboxGameCallableUI" #"Microsoft.XboxIdentityProvider" #"Windows.ContactSupport" # apps which other apps depend on #"Microsoft.Advertising.Xaml" ) foreach ($app in $apps) { Write-Output "Trying to remove $app" Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers Get-AppXProvisionedPackage -Online | Where-Object DisplayName -EQ $app | Remove-AppxProvisionedPackage -Online } # Prevents Apps from re-installing $cdm = @( "ContentDeliveryAllowed" #"FeatureManagementEnabled" "OemPreInstalledAppsEnabled" "PreInstalledAppsEnabled" "PreInstalledAppsEverEnabled" "SilentInstalledAppsEnabled" "SubscribedContent-314559Enabled" "SubscribedContent-338387Enabled" "SubscribedContent-338388Enabled" "SubscribedContent-338389Enabled" "SubscribedContent-338393Enabled" "SubscribedContentEnabled" "SystemPaneSuggestionsEnabled" ) force-mkdir "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" foreach ($key in $cdm) { Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" $key 0 } force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore" Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore" "AutoDownload" 2 # Prevents "Suggested Applications" returning force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" 1 I am putting this code as an example. They are for removing apps in Live Windows mode. A lib folder with 2 files is missing for the script to work. I got this code ready (if I remember correctly) in pastebin. In short, I think: Is it possible to use parentheses, brackets, apostrophes, quotes, etc., in a batch script "* .bat" or "* .cmd" to facilitate the execution of commands? Original code structure Code: if "%Component%" equ "WindowsApps" ( rem if "%ImageArchitecture%" equ "x64" "Mixed Reality Portal App", "MixedRealityPortal" if "%ImageBuild%" leq "18363" "Films and TV App", "ZuneVideo" if "%ImageBuild%" leq "18363" "Messaging App", "Messaging" if "%ImageBuild%" leq "18363" "Mobile Plans App", "OneConnect" rem if "%ImageBuild%" leq "18363" "Print 3D App", "Print3D" rem if "%ImageBuild%" equ "19041" "Cortana App", "Cortana" if "%ImageBuild%" equ "19041" "Films and TV App", "ZuneVideo" rem "Advertising Xaml", "AdvertisingXaml" "Alarms and Clock App", "Alarms" rem "Calculator App", "Calculator" rem "Camera App", "Camera" rem "Desktop App Installer", "DesktopAppInstaller" "Feedback Hub App", "FeedbackHub" "Get Help App", "GetHelp" rem "Google's VP9 WebM Video Codec Plugin", "VP9VideoExtensions" "Groove Music App", "ZuneMusic" rem "High Efficiency Image File Codec Plugin", "HEIFImageExtension" "Maps App", "Maps" "Microsoft Pay App", "WalletService" rem "Mixed Reality Viewer App", "3DViewer" "My Office App", "OfficeHub" rem "OneNote App", "OfficeOneNote" rem "Paint 3D App", "Paint3D" "People App", "People" rem "Photos App", "Photos" rem "Screen Sketch App", "ScreenSketch" "Skype App", "SkypeApp" rem "Solitaire Collection App", "SolitaireCollection" rem "Sticky Notes App", "StickyNotes" "Tips App", "Getstarted" rem "Voice Recorder App", "SoundRecorder" "Weather App", "BingWeather" rem "Web Media Extension Plugin", "WebMediaExtensions" rem "Webp Image Extension Plugin", "WebpImageExtensions" rem "Windows Mail App", "CommunicationsApps" rem "Windows Store App", "WindowsStore" rem "Xbox App", "XboxApp" rem "Xbox Identity Provider", "XboxIdentityProvider" "Your Phone App", "YourPhone" ) New code structure that I idealize... It certainly won't work, as I don't have the knowledge to do it right. Code: if "%Component%" equ "WindowsApps" { rem if "%ImageArchitecture%" equ "x64" "Mixed Reality Portal App", "MixedRealityPortal" if "%ImageBuild%" leq "18363" call :RemoveWindowsComponent "%InstallMount%\%%i" ( "Films and TV App", "ZuneVideo" "Messaging App", "Messaging", "Mobile Plans App", "OneConnect", rem "Print 3D App", "Print3D" ) if "%ImageBuild%" equ "19041" call :RemoveWindowsComponent "%InstallMount%\%%i" ( rem "Cortana App", "Cortana", "Films and TV App", "ZuneVideo" ) call :RemoveWindowsComponent "%InstallMount%\%%i" ( rem "Advertising Xaml", "AdvertisingXaml", "Alarms and Clock App", "Alarms", rem "Calculator App", "Calculator", rem "Camera App", "Camera", rem "Desktop App Installer", "DesktopAppInstaller", "Feedback Hub App", "FeedbackHub", "Get Help App", "GetHelp", rem "Google's VP9 WebM Video Codec Plugin", "VP9VideoExtensions", "Groove Music App", "ZuneMusic", rem "High Efficiency Image File Codec Plugin", "HEIFImageExtension", "Maps App", "Maps", "Microsoft Pay App", "WalletService", rem "Mixed Reality Viewer App", "3DViewer", "My Office App", "OfficeHub", rem "OneNote App", "OfficeOneNote", rem "Paint 3D App", "Paint3D", "People App", "People", rem "Photos App", "Photos", rem "Screen Sketch App", "ScreenSketch", "Skype App", "SkypeApp", rem "Solitaire Collection App", "SolitaireCollection", rem "Sticky Notes App", "StickyNotes", "Tips App", "Getstarted", rem "Voice Recorder App", "SoundRecorder", "Weather App", "BingWeather", rem "Web Media Extension Plugin", "WebMediaExtensions", rem "Webp Image Extension Plugin", "WebpImageExtensions", rem "Windows Mail App", "CommunicationsApps", rem "Windows Store App", "WindowsStore", rem "Xbox App", "XboxApp", rem "Xbox Identity Provider", "XboxIdentityProvider", "Your Phone App", "YourPhone" ) } It's just an idea. I exemplify within my capabilities and limitations. Thank you in advance!
I do not know a great deal about programming, so have not commented before. However I also wondered if the ToolKitHelper could read the RemovePkgsList.txt file in one sweep, then it only has to load it's code once - right now, it currently loads it's code once per line which is proving to be inefficient and slow.
It would be the same working principle that I mentioned earlier. The list keeps on each line a part of the command and a part related to the identification of the app. If only one command could call the list with the application identities, if I understood correctly, there is a process of (mount - removal - unmount) for each app. I imagine the process could be (mount- removal of selected apps - unmount). But this is possible in some languages, it may not be the case with batch script. Perhaps a command like this: call: RemoveLockedPackage "% InstallMount% \ %% i", %% z, %% z ToolKitHelper: ( %RemovePkgsList% ) could call a list with only the names of the App Packages. Like this: Code: "AdobeFlashForWindows", "InternetExplorer", "FirstLogonAnimation", "GameExplorer", "SnippingTool", "SpeechRecognition", Or... Maybe keep the code of the Script and make the structure of the called file like the one bellow: Code: ToolKitHelper:( "AdobeFlashForWindows", "InternetExplorer", "FirstLogonAnimation", "GameExplorer", "SnippingTool", "SpeechRecognition", ) But everything is speculation... I have to better understand the logic of the code. Only @MSMG, and other experienced programmers will be able to give us an opinion if this can be done and what should be corrected in the code for this.
Speaking of simpler code, it's the right time to share the BAT script I prepared for myself. Spoiler: RemovingWithToolKitHelperOnWin10v2004.bat @echo off cd /d "%~dp0" set "NSudo=F:\NSudo\x64\NSudoLC.exe -Wait -UseCurrentConsole -U:T -P:E" set "ToolKitHelper=F:\MSMGToolKit\Bin\ToolKitHelper.exe" set "ImageDir=G:" FOR %%i IN ( 549981C3F5F10 AdobeFlashForWindows FirstLogonAnimation GameExplorer SpeechRecognition WindowsMediaPlayer AssignedAccess CEIP_SQM FaceRecognition KernelDebugging LocationService PicturePassword PinEnrollment UnifiedTelemetryClient WiFiNetworkManager WindowsErrorReporting WindowsInsiderHub HomeGroup MultiPointConnector RemoteAssistance DeviceLockdown EaseOfAccessThemes EasyTransfer FileHistory StepsRecorder SystemRestore WindowsBackup AssignedAccessLockApp BioEnrollment CBSPreview ContentDeliveryManager ECApp EdgeDevToolsClient Edge LockApp MapControl OneDrive NarratorQuickStart ParentalControls PeopleExperienceHost QuickAssist RetailDemoContent SecureAssessmentBrowser SettingSync SkypeORTC WindowsMixedReality WindowsReaderPDF XboxGameCallableUI 3DViewer AdvertisingXaml Alarms BingWeather Calculator Camera CommunicationsApps Cortana FeedbackHub GetHelp Getstarted HEIFImageExtension Maps MixedRealityPortal OfficeHub OfficeOneNote Paint3D People Photos ScreenSketch SkypeApp SolitaireCollection SoundRecorder StickyNotes VP9VideoExtensions WalletService WebMediaExtensions WebpImageExtensions XboxApp XboxIdentityProvider YourPhone ZuneMusic ZuneVideo ) DO (echo ToolKitHelper now removing %%i && %NSudo% %ToolKitHelper% %ImageDir% %%i && echo __) pause I've applied this script to an offlne image (on USB-HDD). I guess there were no issue except a few error window. But I just wanted to apply last update (KB4557957) to offline image. Unfortunately, DISM gives errors (Error: 1168 / HRESULT = 0x80073701 - ERROR_SXS_ASSEMBLY_MISSING). Even If this commands can't fix: Code: dism /image:G:\ /cleanup-image /restorehealth /source:wim:E:\install.wim:2 I know it was a mistake to remove components and apps after SysPrep phase was already over. At least I wanted to share this personal code in order to give ideas to those who want to simplify it. @MSMG, Thank you for ToolkitHelper utiltiy. I will have recommendations for ToolkitHelper v2.x.