![見出し画像](https://assets.st-note.com/production/uploads/images/61306482/rectangle_large_type_2_4c05287841f6e1c1e55535b4edeaa263.png?width=1200)
Win10 Sysprep適用で困った話
------------------------------------------------------------------------------
追記:2024/04/08 Sysprepができないエラーが解消
追記:2024/01/27 2023/11以降KB5032278が原因でエラーが出るらしい
追記:2023/10/17 問題なし
追記:2023/05/16 問題なし
追記:2022/12/19 22H2あてて問題なし
追記:2022/05/18 21H2あててSysprepかけたところ、問題なし
追記:2021/09/21
Microsoft.LanguageExperiencePackja-JPの抜き方について更新しました。
peto335さんありがとうございました。ありがたいnoteを紹介します。
------------------------------------------------------------------------------
発生したエラー
「コンピュータのsysprepを実行中に致命的なエラーが発生しました。」
![画像1](https://assets.st-note.com/production/uploads/images/61276704/picture_pc_83601b162a6ff304cf48fa2324279cb3.png)
エラーの詳細は?
まずは「%WINDIR%\System32\Sysprep\Panther\setupact.log」を確認。
SYSPRP Failed to remove staged package Microsoft.LanguageExperiencePackja-JP_19041.28.81.0_neutral__8wekyb3d8bbwe: 0x80070005.[gle=0x00000091]
SYSPRP Failed to remove apps for the current user: 0x80070005.
SYSPRP Exit code of RemoveAllApps thread was 0x5.[gle=0x0000012a]
SYSPRP Failed to remove all apps: 0x80070005.[gle=0x0000012a]
SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing 'SysprepGeneralize' from C:\Windows\System32\AppxSysprep.dll; dwRet = 0x5[gle=0x0000012a]
SYSPRP SysprepSession::ExecuteAction: Failed during sysprepModule operation; dwRet = 0x5[gle=0x0000012a]
SYSPRP SysprepSession::ExecuteInternal: Error in executing action for Microsoft-Windows-AppX-Sysprep; dwRet = 0x5[gle=0x0000012a]
SYSPRP SysprepSession::Execute: Error in executing actions from C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml; dwRet = 0x5
SYSPRP RunPlatformActions:Failed while executing Sysprep session actions; dwRet = 0x5
[0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x5
[0x0f00a8] SYSPRP WinMain:Hit failure while processing sysprep generalize internal providers; hr = 0x80070005
[0x0f0073] SYSPRP RunDlls:Not running DLLs; either the machine is in an invalid state or we couldn't update the recorded state, dwRet = 0x1f
[0x0f00ae] SYSPRP WinMain:Hit failure while processing sysprep cleanup external providers; hr = 0x8007001f
上記の場合、注目点は1行目の以下
Failed to remove staged package Microsoft.LanguageExperiencePackja-JP_19041.28.81.0_neutral__8wekyb3d8bbwe: 0x80070005.[gle=0x00000091]
Sysprepはストアアプリと干渉してエラーが発生する。
今回のエラーの場合、Microsoft.LanguageExperiencePackja-JPを抜く必要がある。
抜き方としては管理者権限でPowerShellを起動し、以下を実行
Get-AppxPackage -AllUsers Microsoft.LanguageExperiencePackja-JP* | Remove-AppxPackage -AllUsers
肝としては「Get-AppxPackage -AllUsers」以前は無くてもsysprepは通っていたが、全部のユーザで抜くようにしないといけないらしいのでおまじない。
修正したので再度sysprep
しかし、今度は以下のエラー。もうどうしたら良いの?
2021-09-15 15:34:23, Error [0x0f0073] SYSPRP RunDlls:Not running DLLs; either the machine is in an invalid state or we couldn't update the recorded state, dwRet = 0x1f
2021-09-15 15:34:23, Error [0x0f00ae] SYSPRP WinMain:Hit failure while processing sysprep cleanup external providers; hr = 0x8007001f
先人の知恵を借りるために検索したところ、以下を発見。
「Sysprepで「致命的なエラー」」以下を実施して無事適用。
※ささ様、引用許可ありがとうございました。
Sysprepとストアアプリの干渉はいい加減デフォルトで回避できないものか。
次のアクション
大本のイメージ展開について書いてみた。
Win11でも検証してみた。