Mark0's software support board
February 22, 2018, 04:07:25 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the new forum! Guests can posts without registration.
   Home   Help Search Login Register  
Pages: [1]
Author Topic: Tip: Recursively fix files extensions with TrID using PowerShell  (Read 34342 times)
Hero Member
Posts: 1600

« on: April 20, 2010, 06:14:48 pm »

This tip was suggested by Nath and and could interest users of the Windows PowerShell


Foreach ($1 in gci -recurse -name C:\folders_to_scan\) {$1 = "C:\folders_to_scan\" + $1 ; C:\trid_path\trid.exe $1 -ae}

Replace C:\folders_to_scan\ with the directory that you want to scan by TrID to fix the extensions (including the subdirectories).

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

It's also possible to exclude files with common extensions with something like:


Foreach ($1 in gci -recurse -name -exclude *.exe, *.doc, *.xyz C:\folders_to_scan\) {$1 = "C:\folders_to_scan\" + $1 ; C:\trid_path\trid.exe $1 -ae}

A filemask like *.* will exclude any file with an extension (and so analyze only the ones without).
« Last Edit: April 21, 2010, 05:40:16 pm by Mark0 » Logged

Pages: [1]

Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2001-2010, Lewis Media Valid XHTML 1.0! Valid CSS!
Page created in 0.116 seconds with 16 queries.