Snippets Collections
It's possible to work on an entire folder tree, or a particular subset of files, just using the output of some other command through a pipe. Something like:

 	C:\TrID>dir d:\recovered_drive /s /b | trid -ce -@
   
 Definitions found:  5702
 Analyzing...

 File: d:\recovered_drive\notes
 100.0% (.RTF) Rich Text Format (5000/1)

 File: d:\recovered_drive\temp\FILE0001.CHK                           
  77.8% (.OGG) OGG Vorbis Audio (14014/3)
 For /D /R j:\test %%1 IN (*) DO c:\trid_w32\trid "%%1"\* -ae
 
 
Replace j:\test with the directory that you want to move recursively through (TrID will not run on the files in the root of this directory).
 
Replace c:\trid_w32\trid with the path to trid.exe.
 
Dump the line in a batch file and run.
It's possible to tell TrID to show some more information about every match (such as the mime type, who created that definition, how many files were scanned, etc.); and it's also possible to limit the number of results shown. The switch -v activate the verbose mode, and -r:nn specifies the max number of matches that TrID will display. Default is 5 for normal mode, 2 for verbose, 1 for multi-files analysis.

 	C:\TrID>trid "c:\t\Windows XP Startup.ogg" -v -r:2

 TrID/32 - File Identifier v2.24 - (C) 2003-16 By M.Pontello          

 Collecting data from file: c:\t\Windows XP Startup.ogg
 Definitions found: 5702
 Analyzing...

  77.8% (.OGG) OGG Vorbis audio (14014/3)
          Mime type  : audio/ogg
        Definition   : audio-ogg-vorbis.trid.xml
          Files      : 37
        Author       : Marco Pontello
          E-Mail     : marcopon@nospam@gmail.com
          Home Page  : http://mark0.net

  22.2% (.OGG) OGG stream (generic) (4000/1)
        Definition   : ogg-stream.trid.xml
          Files      : 35
        Author       : Marco Pontello
          E-Mail     : marcopon@nospam@gmail.com
          Home Page  : http://mark0.net
Instead, the switch -ce will just change the file extension to the new one; if the file has no extension, the new one will be added. For example:

  IAmASoundFile.dat -> IAmASoundFile.wav
  IAmABitmap -> IAmABitmap.bmp
:: Wildcards can be used to scan groups of files, entire folders, etc. In addition, using the switch -ae will instruct TrID to add the guessed extensions to the filenames. This come handy, for example, when working with files recovered by data rescue softwares. For example:

 C:\TrID>trid c:\temp\* -ae

 
 TrID/32 - File Identifier v2.24 - (C) 2003-16 By M.Pontello          
 Definitions found:  5702
 Analyzing...

 File: c:\temp\FILE0001.CHK
  75.8% (.BAV) The Bat! Antivirus plugin (187530/5/21)

 File: c:\temp\FILE0002.CHK
  77.8% (.OGG) OGG Vorbis Audio (14014/3)

 File: c:\temp\FILE0003.CHK
  86.0% (.DOC) Microsoft Word document (49500/1/4)

 File: c:\temp\FILE0004.CHK
  42.6% (.EXE) UPX compressed Win32 Executable (30569/9/7)

  4 file(s) renamed.
for /R /D %I IN (*.*) DO TRID "%I\*" ce
 For /D /R j:\test %%1 IN (*) DO c:\trid_w32\trid "%%1"\* -ae


Replace j:\test with the directory that you want to move recursively through (TrID will not run on the files in the root of this directory).

Replace c:\trid_w32\trid with the path to trid.exe.

Dump the line in a batch file and run.
star

Tue Feb 25 2025 08:08:54 GMT+0000 (Coordinated Universal Time)

#trid #stdin
star

Wed Nov 06 2024 21:27:39 GMT+0000 (Coordinated Universal Time)

#trid #batch #windows #file
star

Fri Jun 21 2024 15:20:11 GMT+0000 (Coordinated Universal Time) https://mark0.net/soft-trid-e.html

#trid #verbose
star

Fri Jun 21 2024 15:19:19 GMT+0000 (Coordinated Universal Time) https://mark0.net/soft-trid-e.html

#trid #extension
star

Fri Jun 21 2024 15:17:53 GMT+0000 (Coordinated Universal Time) https://mark0.net/soft-trid-e.html

#trid #wildcard
star

Wed Jun 19 2024 08:09:21 GMT+0000 (Coordinated Universal Time) https://www.reddit.com/r/commandline/comments/17beywz/parse_through_all_subdirectories_and_run_a_exe_on/?rdt

#batch #file #trid
star

Wed Jun 19 2024 08:05:14 GMT+0000 (Coordinated Universal Time) https://mark0.net/forum/index.php?topic

#trid #batch #windows #files #extention

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension