I'm trying to deploy some Windows 10 machines at work, and need to remove or disable the pre-installed apps.
For some reason, management feels that the Xbox app and Candy Crush Soda Saga (etc.) shouldn't be installed on a corporate workstation.
We've tried uninstalling them after the fact, but they show up again for any new users logging in, which isn't acceptable. How do we really get rid of these apps from our corporate Windows 10 image?
The easiest method I've found to actually control a Windows 10 image is to edit it with the Deployment Image Servicing and Management (DISM.exe) tool.
In short, you need to:
Locate the Windows wim for the image you're deploying.
\sources\install.wim
Create a directory to temporarily mount the wim in.
Mount the wim.
Make your changes.
Commit the changes and unmount the WIM.
In more detail:
Locate the Windows wim.
D:
. (Be sure to mount it with read-write access, of course!)D:\sources\install.wim
. I'll assign that to a PowerShell variable.$wimfile = "D:\sources\install.wim"
Create a directory to temporarily mount the wim in.
C:\Temp\W10entDISM
, and assign that to a PowerShell variable as well.$mountdir = "C:\Temp\W10entDISM"
Mount the wim with DISM.
dism.exe /Mount-Image /ImageFile:$wimfile /Index:1 /MountDir:$mountdir
Make your changes.
OneDriveSetup.exe
and registry entries to run it automatically, which I'll be eliminating, using the File System Security PowerShell Module and command line registry editor,reg.exe
. Of course, this can be done manually or with other command line tools, if preferred.takeown /F $mountdir\Windows\SysWOW64\OneDriveSetup.exe /A
Add-NTFSAccess -Path "$($mountdir)\Windows\SysWOW64\onedrivesetup.exe" -Account "BUILTIN\Administrators" -AccessRights FullControl
Remove-Item $mountdir\Windows\SysWOW64\onedrivesetup.exe
reg load HKEY_LOCAL_MACHINE\WIM $mountdir\Users\Default\ntuser.dat
reg delete "HKEY_LOCAL_MACHINE\WIM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg add HKEY_LOCAL_MACHINE\WIM\SOFTWARE\Policies\Microsoft\Windows\CloudContent
reg add HKEY_LOCAL_MACHINE\WIM\SOFTWARE\Policies\Microsoft\Windows\CloudContent /v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f
reg unload HKEY_LOCAL_MACHINE\WIM
Get-AppxProvisionedPackage -Path $mountdir
) Importantly, not all the pre-installed Appx apps can or should be removed. As of the time of this writing, it is recommended to not uninstall the AppConnector, ConnectivityStore, and WindowsStore (their use can be disabled in other ways, if desired, but actually removing them has been reported to break things and create undesired consequences). Also worth noting that in Windows 10, the Windows Calculator is an Appx package.dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingNews_4.6.169.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingSports_4.6.169.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingWeather_4.6.169.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingFinance_4.6.169.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.CommsPhone_1.10.15000.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Messaging_1.10.22012.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftOfficeHub_2015.6306.23501.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Office.OneNote_2015.6131.10051.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.SkypeApp_3.2.1.0_neutral_~_kzf8qxf38zg5c
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Windows.Photos_2015.1001.17200.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsCamera_2015.1071.40.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsPhone_2015.1009.10.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsAlarms_2015.1012.20.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:microsoft.windowscommunicationsapps_2015.6308.42271.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsMaps_4.1509.50911.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsSoundRecorder_2015.1012.110.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxApp_2015.930.526.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneMusic_2019.6.13251.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneVideo_2019.6.13251.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Office.Sway_2015.6216.20251.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.People_2015.1012.106.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Getstarted_2.3.7.0_neutral_~_8wekyb3d8bbwe
dism.exe /Image:$mountdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.3DBuilder_10.9.50.0_neutral_~_8wekyb3d8bbwe
Commit the changes and unmount the WIM.
dism.exe /Unmount-Image /MountDir:$mountdir /commit
Just teh codez:
You should now have an ISO and/or wim file that you can use to install Windows 10 without the added crap, or feed into your configuration/deployment management system. A screenclip of the Start Menu from a resulting OS deployment:
OneDrive and Cortana can't be removed the normal way. You need to edit the registry to enable hidden packages under "HKLM:\Software\Microsoft\Windows\Windows Components".
I have built my own tool for customizing Windows 10 (tested on Win 10 -1709 Enterprise). It is mostly written in powershell, so might be easier to read and maintain than the more common batch files you get in forums. You can check the code for details.
The easiest way would be deploying Windows 10 LTSB. Enterprise LTSB is a long-term support version of Windows 10 Enterprise released every 2 to 3 years. Basically, this is Windows 10 without the whole app stuff; No Microsoft Store, no Microsoft Edge, no apps at all.
This obviously requires an entirely different ISO. They are supported with security updates for 10 years after their release, and intentionally receive no feature updates.
If you already have a Windows 10 Enterprise E3 (per device) plan via Volume Licensing, you're allowed to download and install Windows 10 Enterprise LTSB.
More details: http://download.microsoft.com/download/2/D/1/2D14FE17-66C2-4D4C-AF73-E122930B60F6/Windows-10-Volume-Licensing-Guide.pdf
If you can't or don't want to change the OS, you should be able to uninstall all apps via PowerShell:
Run as admin: Get-AppXProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online Get-AppxPackage -allusers | Remove-AppxPackage
Run as user: Get-AppxPackage | Remove-AppxPackage
Please keep in mind that those commands will uninstall all apps except Cortana, Edge and Microsoft Store. You'll loose the calculator as well by doing so, just for your information.