Answers:
我发现实际控制Windows 10映像的最简单方法是使用“ 部署映像服务和管理(DISM.exe)”工具对其进行编辑。
简而言之,您需要:
找到要部署的映像的Windows Wim。
\sources\install.wim
创建一个目录来临时挂载wim。
装上wim。
进行更改。
提交更改并卸载WIM。
更详细地:
找到Windows WIM。
D:
。(当然,请确保以读写访问权限安装它!)D:\sources\install.wim
。我将其分配给PowerShell变量。
$wimfile = "D:\sources\install.wim"
创建一个目录来临时挂载wim。
C:\Temp\W10entDISM
,并将其也分配给PowerShell变量。
$mountdir = "C:\Temp\W10entDISM"
dism.exe /Mount-Image /ImageFile:$wimfile /Index:1 /MountDir:$mountdir
进行更改。
OneDriveSetup.exe
并且具有注册表项以自动运行该文件,我将使用文件系统安全PowerShell模块和命令行注册表编辑器来删除它reg.exe
。当然,这可以手动完成,也可以使用其他命令行工具(如果需要)完成。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
)重要的是,并非所有预装的Appx应用都可以或应该删除。在撰写本文时,建议不要卸载AppConnector,ConnectivityStore和WindowsStore(如果需要,可以以其他方式禁用它们的使用,但是据报道,实际上删除它们会破坏事情并产生不良后果)。同样值得注意的是,在Windows 10中,Windows计算器是一个Appx程序包。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
提交更改并卸载WIM。
dism.exe /Unmount-Image /MountDir:$mountdir /commit
只是Codez:
$wimfile = "D:\sources\install.wim"
$mountdir = "C:\Temp\W10entDISM"
dism.exe /Mount-Image /ImageFile:$wimfile /Index:1 /MountDir:$mountdir
# Remove Appx Packages
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
# Remove OneDrive Setup
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
# Remove Cloud Content
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
# Unload, Unmount, Commit
reg unload HKEY_LOCAL_MACHINE\WIM
dism.exe /Unmount-Image /MountDir:$mountdir /commit
现在,您应该具有一个ISO和/或WIM文件,可用于安装Windows 10而无需添加废话,或将其输入到配置/部署管理系统中。最终OS部署中“开始”菜单的屏幕快照:
最简单的方法是部署Windows 10 LTSB。企业级LTSB是Windows 10企业版的长期支持版本,每2至3年发布一次。基本上,这是Windows 10,没有完整的应用程序内容。没有Microsoft Store,没有Microsoft Edge,根本没有应用程序。
显然,这需要完全不同的ISO。它们在发行后的10年中受到安全更新的支持,并且有意不接受任何功能更新。
如果您已经通过批量许可制定了Windows 10 Enterprise E3(每设备)计划,则可以下载并安装Windows 10 Enterprise LTSB。
更多详细信息:http : //download.microsoft.com/download/2/D/1/2D14FE17-66C2-4D4C-AF73-E122930B60F6/Windows-10-Volume-Licensing-Guide.pdf
如果您不能或不想更改操作系统,则应该能够通过PowerShell卸载所有应用程序:
以管理员身份运行:Get-AppXProvisionedPackage -Online | Remove-AppxProvisionedPackage-在线Get-AppxPackage -allusers | Remove-AppxPackage
以用户身份运行:Get-AppxPackage | Remove-AppxPackage
请记住,这些命令将卸载除Cortana,Edge和Microsoft Store之外的所有应用程序。您也将为此放松计算器,仅供参考。