Mark0's software support board
May 26, 2017, 01:46:24 am *
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]
  Print  
Author Topic: Tip: Recursively fix files extensions with TrID using PowerShell  (Read 33081 times)
Mark0
Administrator
Hero Member
*****
Posts: 1422



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

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

Code:

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:

Code:

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]
  Print  

 
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.089 seconds with 16 queries.