computing
  • 9

Solved Generate And Append Dxdiag Data To a Text File

  • 9

Hi,

I need to generate a DxDiag report and then append it to an all encompassing report using one single bat file. But the script keeps giving me an error message that the file can not be found. To generate the dxdiag I’ve used:

dxdiag /t C:\General\Reports\dxdiag.txt

I have then used the type command to try to append the Dxdiag data into the report:

type “C:\General\Reports\dxdiag.txt” >Fullreport.txt

But it keeps telling me the file can not be found, even though I can see that the file is being generated by the first command in the specified path.

Wondering if you could shed some light into this noobie’s confusion.

Thanks in advanced!

-sekão

Share

1 Answer

  1. Dxdiag needs a relevant time interval to execute so if the Type command immediately follows it the result file may still be not generated. While executables inside a batch perform sequentially, dxdiag natively runs in multitask mode so the script flow must be explicitly synchronized coding

    start “” /Wait dxdiag /T C:\General\Reports\dxdiag.txt
    type C:\General\Reports\dxdiag.txt >> Fullreport.txt

    Better you use the >> redirector that appends the text otherwise you will overwrite the previous content of the target file.

    • 0