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:
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.
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).
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.
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.
User contributions licensed under CC BY-SA 3.0