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

4

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.

windows-7
windows
troubleshooting
platform
answerfile
asked on Super User Jan 31, 2015 by semtex41 • edited Jun 29, 2016 by Giacomo1968

2 Answers

4

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).

answered on Super User Jun 16, 2015 by Tonedef_Spacetornado
4

The suggested solution is theoretically correct but won't work with WindowsUpdateDiagnostic.diagcab because this one includes two WTP Packages in a single diagcab cabinet file.

  1. Therefore please expand the diagcab file using expand.exe, 7Zip or the like to c:\wud\
  2. Then run Powershell with elevated privileges (right click/run as administator)
  3. type "Import-Module TroubleshootingPack"
  4. then continue using the previously stated solution i.e. run "Get-TroubleshootingPack C:\wud\BitsDiagnostic -AnswerFile c:\wud\answer_bits.xml"
  5. and "Get-TroubleshootingPack C:\wud\windowsupdatediagnostic -AnswerFile c:\wud\answer_wud.xml"

Now you have two answer files and a corresponding directory c:\wud which can be deployed and invoked using

Get-TroubleshootingPack -Path C:\wud\windowsupdatediagnostic | Invoke-TroubleshootingPack -AnswerFile c:\wud\answer_wud.xml -Unattended -Result c:\wud\log_wud

and

Get-TroubleshootingPack -Path C:\wud\BitsDiagnostic | Invoke-TroubleshootingPack -AnswerFile c:\wud\answer_bits.xml -Unattended -Result c:\wud\log_bits

I don't know if one can make it using the "multi-diagcab" with two answer files and msdt.exe... Presumably not.

answered on Super User Jun 28, 2016 by Gizmo0001 • edited Jun 29, 2016 by RockPaperLz- Mask it or Casket

User contributions licensed under CC BY-SA 3.0