使用Windows Kits创建PE 及精简镜像
执行命令报错
ERROR: The following processor architecture was not found: amd64.
找到 部署和映像工具环境 右键 管理员权限运行
使用wimboot启动不要改boot.wim的名字
卵用没有的相关资料:
https://kb.acronis.com/content/68324
https://www.sxj.xyz/make-winpe.html
https://777notes.wordpress.com/2013/10/21/winpe-the-following-processor-architecture-was-not-found-amd64/
使用Windows Kits创建PE
找到 部署和映像工具环境 右键 管理员权限运行
copype amd64 C:\Users\work\Desktop\pe
mkdir C:\Users\work\Desktop\tmp
Dism /mount-image /imagefile:"C:\Users\work\Desktop\pe\media\sources\boot.wim" /index:1 /mountdir:"C:\Users\work\Desktop\tmp"
#Dism /mount-image /imagefile:"C:\Users\work\Desktop\boot.wim" /index:1 /mountdir:"C:\Users\work\Desktop\tmp"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\zh-cn\WinPE-WMI_zh-cn.cab"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-NetFx.cab"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\zh-cn\WinPE-NetFx_zh-cn.cab"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Scripting.cab"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\zh-cn\WinPE-Scripting_zh-cn.cab"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PowerShell.cab"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\zh-cn\WinPE-PowerShell_zh-cn.cab"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-StorageWMI.cab"
Dism /Add-Package /Image:"C:\Users\work\Desktop\tmp" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\zh-cn\WinPE-StorageWMI_zh-cn.cab"
Dism /Image:"C:\Users\work\Desktop\tmp" /Add-Driver /Driver:C:\Users\work\Desktop\Winx64\NDIS68 /Recurse
dism /commit-image /mountdir:"C:\Users\work\Desktop\tmp"
dism /unmount-image /mountdir:"C:\Users\work\Desktop\tmp" /discard
集成驱动
Dism /Image:"C:\wim" /Add-Driver /Driver:C:\Winx64\NDIS68 /Recurse
获取包名
Dism /Image:C:\wim /Get-ProvisionedAppxPackages
卸载相应包
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:
简单精简镜像
D盘为光驱驱动器,处理第二项企业镜像。
mkdir C:\wim
copy D:\sources\install.wim C:\
dism /Mount-wim /WimFile:"C:\install.wim" /index:2 /MountDir:"C:\wim"
takeown /f "C:\wim\windows\system32\onedrivesetup.exe"
icacls "C:\wim\windows\system32\onedrivesetup.exe" /grant administrators:F"
del C:\wim\windows\system32\onedrivesetup.exe
takeown /f "C:\wim\windows\syswow64\onedrivesetup.exe"
icacls "C:\wim\windows\syswow64\onedrivesetup.exe" /grant administrators:F"
del C:\wim\windows\syswow64\onedrivesetup.exe
reg load HKLM\test C:\wim\Users\default\ntuser.dat
reg delete HKLM\test\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v OneDriveSetup
reg unload HKLM\test
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsFeedbackHub_2019.1111.2029.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.SkypeApp_14.53.77.0_neutral_~_kzf8qxf38zg5c
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftOfficeHub_18.1903.1152.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.GetHelp_10.1706.13331.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftSolitaireCollection_4.4.8204.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Office.OneNote_16001.12026.20112.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Getstarted_8.2.22942.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.YourPhone_2019.430.2026.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.People_2019.305.632.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Wallet_2.4.18324.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsMaps_2019.716.2316.0_neutral_~_8wekyb3d8bbwe
Dism /Image:C:\wim /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingWeather_4.25.20211.0_neutral_~_8wekyb3d8bbwe
dism /UnMount-wim /MountDir:C:\wim /commit
dism /Export-Image /SourceImageFile:"C:\install.wim" /SourceIndex:2 /DestinationImageFile:"C:\install2.wim"