Windows – Creating an answer file for “WindowsUpdateDiagnostic.diagcab” in Eclipse WTP

answerfileplatformtroubleshootingwindowswindows 7

I am attempting to script the install of the WindowsUpdateDiagnostic.diagcab sourced here.

msdt.exe /cab "%~dp0WindowsUpdateDiagnostic.diagcab" -af "%~dp0stillneeded.xml"

Unfortunately, attempts at creating a answer file seems to have failed:

enter image description here

Not finding much on 0x80092003. I am hoping with an example answers.xml, I could spoof the answers and make it work.

Here is a template, but I havn't had any luck.

<Answers>

  <Interaction ID="IT_Theme">

  <Value>Nature</Value>

  </Interaction>

</Answers>

Sourced: https://msdn.microsoft.com/en-us/library/dd776530.aspx#CommandLineAdministration

Thanks in advance.

Best Answer

You can use the Get-TroubleshootingPack (https://msdn.microsoft.com/en-us/library/dd323716(v=vs.85).aspx) cmdlet in PowerShell to create an answer file:

Get-TroubleshootingPack C:\Windows\Diagnostics\system\WindowsUpdate -AnswerFile c:\WUDAnswers.xml

(Note that it uses the path to the existing troubleshooter in %systemroot% (usually C:\Windows), not the .diagcab file. I have not been able to create an answer file using the .diagcab file).

This should just ask you one question, and you type "1 [Enter]" to answer "Apply Fix." Then you can create a PowerShell script (.ps1) with just this line in it:

Get-TroubleshootingPack -Path C:\Windows\diagnostics\system\WindowsUpdate | Invoke-TroubleshootingPack -AnswerFile c:\WUDAnswers.xml -Unattended -Result c:\WUDResult

And you can run that PowerShell script with a command like this:

powershell -ExecutionPolicy Bypass -file c:\RunWindowsUpdateDiagnostics.ps1

...which should create 3 or more files in C:\WUDResult (change the paths as you want).

Related Question