升級Windows時失敗後的 troubleshoot 第一步

  • 34
  • 0
  • 2024-04-21

Windows update troubleshoot 0x8007000d

包含 Windows 10->11, Windows Server 2016->2019,我升級時都遇過失敗的狀況

失敗後Windows會維持在原本的版本,且Updater內可能會顯示錯誤訊息,如下圖

 

 

此時,可以進入下面這個資料夾

C:\$WINDOWS.~BT\Sources\Panther

找到 setuperr.log 和 setupact.log 這兩個檔案,

主要是 setuperr.log ,讀裡面的資訊,再利用裡面錯誤的資訊去搜尋解決方法

到這裡也一樣困難,但至少比一個籠統地錯誤代碼有頭緒

 

分析 setuperr.log 時,通常從最後一筆開始分析,

雖然 setuperr.log 可能有一堆 error,但導致安裝失敗的通常是最後一筆。

例如我安裝 windows 10 時就遇到

(上略)
2024-04-20 00:48:35, Error                 SP         Failure while getting the known folder path for CSIDL_PRINTHOOD (S-1-5-82-271721585-897601226-2024613209-625570482-296978595): Win32Exception: 系統找不到指定的檔案。 [0x00000002] class UnBCL::String *__cdecl Mig::CFacadeUser::GetKnownFolderLocation(class UnBCL::String *,int *,class UnBCL::String **)[gle=0x000036b7]
2024-04-20 00:48:35, Error                 SP         Failure while getting the known folder path for CSIDL_PRINTHOOD (S-1-5-21-2946099512-3784408455-29580964-1191): Win32Exception: 系統找不到指定的檔案。 [0x00000002] class UnBCL::String *__cdecl Mig::CFacadeUser::GetKnownFolderLocation(class UnBCL::String *,int *,class UnBCL::String **)[gle=0x000036b7]
2024-04-20 00:48:35, Error                 SP         Failure while getting the known folder path for CSIDL_PRINTHOOD (S-1-5-82-2326120601-2438243479-695244635-805597502-3774143654): Win32Exception: 系統找不到指定的檔案。 [0x00000002] class UnBCL::String *__cdecl Mig::CFacadeUser::GetKnownFolderLocation(class UnBCL::String *,int *,class UnBCL::String **)[gle=0x000036b7]
2024-04-20 00:48:35, Error                 SP         Failure while getting the known folder path for CSIDL_PRINTHOOD (S-1-5-21-2946099512-3784408455-29580964-1001): Win32Exception: 系統找不到指定的檔案。 [0x00000002] class UnBCL::String *__cdecl Mig::CFacadeUser::GetKnownFolderLocation(class UnBCL::String *,int *,class UnBCL::String **)[gle=0x000036b7]
2024-04-20 00:48:35, Error                 SP         Failure while getting the known folder path for CSIDL_PRINTHOOD (S-1-5-82-3876422241-1344743610-1729199087-774402673-2621913236): Win32Exception: 系統找不到指定的檔案。 [0x00000002] class UnBCL::String *__cdecl Mig::CFacadeUser::GetKnownFolderLocation(class UnBCL::String *,int *,class UnBCL::String **)[gle=0x000036b7]
2024-04-20 00:48:35, Error                 SP         Failure while getting the known folder path for CSIDL_PRINTHOOD (S-1-5-82-3205215304-3659445042-2777001118-887978431-1112473181): Win32Exception: 系統找不到指定的檔案。 [0x00000002] class UnBCL::String *__cdecl Mig::CFacadeUser::GetKnownFolderLocation(class UnBCL::String *,int *,class UnBCL::String **)[gle=0x000036b7]
2024-04-20 00:48:35, Error                 SP         Failure while getting the known folder path for CSIDL_PRINTHOOD (S-1-5-21-2946099512-3784408455-29580964-1194): Win32Exception: 系統找不到指定的檔案。 [0x00000002] class UnBCL::String *__cdecl Mig::CFacadeUser::GetKnownFolderLocation(class UnBCL::String *,int *,class UnBCL::String **)[gle=0x000036b7]
2024-04-20 00:48:35, Error                 SP         Failure while getting the known folder path for CSIDL_PRINTHOOD (S-1-5-82-3006700770-424185619-1745488364-794895919-4004696415): Win32Exception: 系統找不到指定的檔案。 [0x00000002] class UnBCL::String *__cdecl Mig::CFacadeUser::GetKnownFolderLocation(class UnBCL::String *,int *,class UnBCL::String **)[gle=0x000036b7]
2024-04-20 00:48:35, Error                 SP         Failure while getting the known folder path for CSIDL_PRINTHOOD (S-1-5-21-2946099512-3784408455-29580964-1192): Win32Exception: 系統找不到指定的檔案。 [0x00000002] class UnBCL::String *__cdecl Mig::CFacadeUser::GetKnownFolderLocation(class UnBCL::String *,int *,class UnBCL::String **)[gle=0x000036b7]
2024-04-20 00:49:54, Error                            WsmLoad: Failed FilterLoad(); hr = 0x801f0013
2024-04-20 00:49:54, Error                 SP         SPInitializeMonitoringDriver: SETUPMON: Failed to load the monitoring filter driver. Error: 0x801F0013
2024-04-20 00:49:54, Error                 SP         SETUPMON: Failed to install/start monitoring driver. Error: 0x801F0013
2024-04-20 00:49:54, Error                 SP     Operation failed: Start Monitoring Driver. Error: 0x801F0013[gle=0x000000b7]
2024-04-20 00:49:55, Error                 SP     COperationQueue::Sort: Could not find an execution phase for 68
2024-04-20 00:49:55, Error                 SP     ExecuteOperations: Operations cannot be sorted. This is a fatal failure.
2024-04-20 00:49:55, Error                 SP     Operation execution failed: 9. hr = 0x801F0013
2024-04-20 00:49:55, Error                 SP     ExecuteOperations: Main operation execution failed. Error: 0x8007000D
2024-04-20 00:49:55, Error                 SP     ExecuteOperations: Failed execution phase Safe OS. Error: 0x8007000D
2024-04-20 00:49:55, Error                 SP     CSetupPlatformPrivate::Execute: Execution of operations queue failed, abandoning. Error: 0x8007000D

最終錯誤碼是 0x8007000D,而上一級的是 0x801F0013,

再往上看錯誤訊息看不太懂,但 CSIDL_PRINTHOOD 感覺好像跟印表機有關係。

我沒有實體印表機,那先試試把以前裝的虛擬印表機移除。

Microsoft XPS Document Writer,就懷疑是你了! 

去裝置管理員把它刪除,再試著安裝一次,就安裝成功了

安裝完成後,可以打開

%windir%\Panther\setuperr.log

一樣可以看到一堆 error,不過不影響安裝