command prompt (admin)
install用のファイルを置いたドライブを <DRV> として記載
- MediaCreationToolなどOSメディアを作成しておく
- dism /Online /Cleanup-Image /CheckHealth
- dism /Get-WimInfo /WimFile:<DRV>:\path\to\install.esd ( example:: d:\sources\install.esd )
or
dism /Get-ImageInfo /ImageFile:<DRV>:\path\to\install.esd ( example:: d:\sources\install.esd ) - 出力から、自分が使用しているOSのIndexの値をメモ
- dism /export-image /SourceImageFile:<DRV>:\path\to\install.esd /SourceIndex:IndexNumber /DestinationImageFile:<DRV>:\path\to\install.wim /Compress:max /CheckIntegrity
※ IndexNumberは工程3の値に置換する - dism /Online /Cleanup-Image /StartComponentCleanup
- dism /Online /Cleanup-Image /AnalyzeComponentStore
- dism /Online /Cleanup-Image /RestoreHealth /Source:WIM:<DRV>:\path\to\install.wim:1 /LimitAccess
- (エラーで止まった場合、再度) dism /Online /Cleanup-Image /RestoreHealth
- sfc /scannow
memo
DISM /Online /Cleanup-Image /RestoreHealth /source:ESD:<DRV>:\path\to\Install.esd:IndexNumber /LimitAccess
- <DRV>にmountディレクトリを作成
- dism /Apply-Image /ImageFile:<DRV>:\path\to\install.esd /index:IndexNumber /Applydir:X:\mount
※ IndexNumberは上述 - <DRV>:\mount に Windows フォルダがあるか確認
- dism /Online /Cleanup-Image /CheckHealth
- dism /Online /Cleanup-Image /RestoreHealth /Source:<DRV>:\mount\windows /LimitAccess
- dism /unmount-wim /Mountdir:<DRV>:\mount /discard
- dism /Cleanup-Wim
- sfc /scannow
- powershell
- Get-AppXPackage -AllUsers |Where-Object {$_.InstallLocation -like “*SystemApps*”} | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}
- SHUTDOWN -> WAKE