Author Topic: How to automate TrID identification of the files in a directory using the CMD?  (Read 5411 times)

Sepehr

  • Newbie
  • *
  • Posts: 1
I've got lots of files without file extensions or having wrong file extensions by using data recovery software like Recuva. I guess it is possible to write a simple batch file or a command line program to go through each and every file in a directory, identify each one's type and extension using TrID, and then assigning the most relevant file extension to the file until it has gone through every file in the directory.
Would you please help me with writing this simple program? I'm a newbie to programming.
Thank you.

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Hi!
Sorry for the late reply.

You could use the -ce switch, and run TrID against all the files in a dir typing something like:

Code: [Select]
c:\trid\> trid -ce \mydir\*.*

pdupreez

  • Newbie
  • *
  • Posts: 5
Is it possible to also do subdirectories? I have used your Powershell example, but I find that it somehow misses files. Also, is it possible to change the -v option output to something a bit more like a single line as it scrolls so quickly out of the screen space that it is impossible to read when you do a multi file change as OP wants to do.

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Is it possible to also do subdirectories?

Yes, you could use a list file. See here: http://mark0.net/forum/index.php/topic,620.0.html

Quote
I have used your Powershell example, but I find that it somehow misses files.

It currently can't work on files with non-ASCII characters in the filename, and files marked as hidden/system.