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
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.
try doing this in a batch file dxdiag /t dxdiag.txt
if exist dxdiag.txt (echo File exists & type dxdiag.txt >> fullreport.txt) else echo File Does Not Exist & goto end
if exist fullreport.txt echo File Safely appended to fullreport.txt
:endif that works in the CURRENT directory, then you can add the full path to the files. If that DOESNT work, then you might have permission issues with the folder. You can use the %temp% variable as a safe location to put your files in (for testing purposes)
gl
| « [Solved] Create Batch file to rand... | [Solved] Split one file into multi... » |