Mark0's Forum

Software => TrID File Identifier => Topic started by: Sepehr on August 01, 2018, 10:46:31 AM

Title: How to automate TrID identification of the files in a directory using the CMD?
Post by: Sepehr on August 01, 2018, 10:46:31 AM
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.
Title: Re: How to automate TrID identification of the files in a directory using the CMD?
Post by: Mark0 on August 11, 2018, 05:39:25 PM
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\*.*
Title: Re: How to automate TrID identification of the files in a directory using the CMD?
Post by: pdupreez on August 24, 2018, 06:50:51 PM
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.
Title: Re: How to automate TrID identification of the files in a directory using the CMD?
Post by: Mark0 on August 24, 2018, 08:00:25 PM
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.