Thursday, October 03, 2013

How to Make a Batch File With TRID to Check if a Bunch of DOCX Files Are Worth Trying to Recover

Here are details of how to make a batch file for Marco Pontello's TRID utility to check your corrupt DOCXs files to see if they are worth trying to recover. The method of analysis is useful for corrupt DOC, XLS, XLSX, PPT and PPTX files too.
    1. Move all your corrupt files into one folder. 

    2. At the end of the this main page on Marco Pontello's site,, download "Win32 TrID v2.10, 29KB ZIP" and the "TrIDDefs.TRD package, 665KB ZIP". Unzip the two zip files and copy the two main files, the exe and the triddefs.trd files, into your corrupt file folder.
      3. Hold down the Shift key and right-click in Windows Explorer, in the folder in white space, when no files are selected to get a choice on the right click menu "Open command window here" and select the choice:
      Inline image 3

      4. In the command window type this command "dir > corrupt-list.txt" and hit return to create a list of your corrupt files in a text file called corrupt-list.tx.

      Inline image 6

      5. In your folder open corrupt-list.txt. Hit Ctl-A and then Ctl-C to copy the file contents to your clipboard.

      Inline image 1

      6. Open and new Excel file and paste the clipboard contents in cell A1.

      Inline image 2

      7. Select the Data menu and make the choice in the middle of the toolbar or old menu to make your data formatted from "Text to Columns".

      Inline image 3

      8. Accept the default radio button position of fixed width or select it if it has not been selected and click next.

      Inline image 4

      9. For all the thin black vertical printing arrow except the one furthest to the right, click on them with your left mouse button, hold down the button and then make a movement up and to the right right and then release the mouse button, this should make them disappear so you are left with only one thin upward black arrow.

      Inline image 5

      10. Scroll on the right until you start seeing data. Click on your left mouse button and hold it down again and gingerly move the last arrow so it is just before the names of the files in your corrupt file folder and let go of your mouse button. Also then click the Next button on the lower right.

      Inline image 6

      11. On the next window that appears, in the upper right click move the radio button to "Do not import." This will have the effect of eliminating all the data from your worksheet that appears to the left of the thin vertical black arrow. You don't have to do anything more, just click the finish button.

      Inline image 7

      12. Remove the first few row of resulting data that don't have names of files in them by highlighting then right clicking on the row labels of your worksheet and choosing delete.

      Inline image 8

      13. There are some extra couple of rows at the end which don't contain data and your text file row which is not a name of an actual corrupt file which you should delete too. 

      Inline image 9

      14. Double click on the line between column A and B so the column size increases to fit the names of the files. Now you are going to make a batch file. In cell B1 put this formula including the equal sign and copy it to the bottom of the column until the last row where there is a corrupt file name:

      ="trid.exe """ & A1 & """"

      15. Open up a blank notepad text file and copy and paste the resulting column B of cells from Excel to your text file. 

      Inline image 2

      16. Change the Save as Type drop-down box from Text Documents (*.txt), to All files (*.*) and then save the file in your corrupt file folder with the name something like: trid.bat. Make sure the file ends in the ".bat" extension.

      Inline image 3

      17. Run you batch file and send the results into a new text file: say by putting this in at the hopefully still open command line: "trid.bat > corruptFileIDs.txt", without the quotes of course.

      Inline image 4

      18. Open your newly created report text file, I called mine corruptFileIDs.txt. Any file that has any part docx, doc, ole or zip format is worth working on with software or services mentioned in this blog.

      Inline image 5

      19. If you run the batch file and you get a response of anything like this:  "80.0% (.DOC) Microsoft Word document (32000/1/3) 20.0% (.) Generic OLE2 / Multistream Compound File (8000/1)", the file might just be a DOC one instead of a DOCX. Try changing the extension to .doc. 

      If that doesn't work, keeping in mind that doc files store text in an uncoded format open the files up in NotePad and look for plain text. The text is stored toward the end in a healthy doc one.

      You can also change the extension to doc and use the free text extractor RepairMyWord: If the file is a docx one and has a partial or full zip structure you won't see much with RepairMyWord.

      1 comment:

      Jit Geet said...

      If all method's fail to recover your important data then try Kernel Recovery for Word. For more information about tool, at here :

      Hasleo Data Recovery FreeV3.2 - Free as in Freeware - Permanently from Hasleo Software "Hasleo Data Recovery FreeV3.2 100% Free Data Recovery Software...