TC Bat Builder Launcher


This tool get a list of file, build and launch a batch accordind to some options and parameters.

More details :
this is a lst2multi replacement with Much More features !

A) Why should i use it ?
- I want to execute some command from TC toolbar with more than one file (the %l %L).
- the command i want to execute is an internal shell command.
- I want to execute more than one command at the time.
Personnaly I use inside TC to launch a lot of imagemagick command resize,rotate,contrast...integrated inside a nice toolbar ;)
I also use it to concatenate all the file together, rename/copy folder and files,...
unzip all selected file into a target folder

B) is it easy to use ?
- if you know how to do thing with a dos console you are able to use it !

C) Why a bat/cmd file is used :
- you can use all system command (echo, ren, copy, move, .... ) depending of your command interpreter.
- the -e option allow you to edit in notepad the created batch in order to complete / modify before execution.

Download new version 0.83(include super_wdx)

Download only programm update 0.83

Bat Builder Launcher version 0.83
---------------------------------
Build and launch a bat script with commands for each file present in the ListFile. 
---------------------------------

usage: 
tcbl [Option] [cmd file] InputFile 'command name or command line'
	[cmd file]	: Alternate ini file containing TCBL commands (only if -I is present !).
	InputFile	: File containing a list of file/folder name.
	command name and 1 to 9 parameters	: is used with the ini file definition (see ini file)
	command line	: is the 'encoded' bat script where
	Structure Section	:
		' $( ' is the separator between initialization and repeated commands.
		' )$ ' is the separator between repeated and finalization commands.
		$; is the separator between 2 line.

	File Section	:
		$f replace the complete filename (with path).
		$p replace the path.
		$n replace the file name.
		$e replace the file extension without preceeding '.'
		$x is $f without extension.
		$z is $n without extension.

	Counter Section	:
		$i is the file index   1 to 99999999.
		$c is the file counter 0001 to 9999.
		$C is the file counter 000000001 to 999999999.

	Date Time Section	:
		$D is the day number dd.
		$M is the month number mm.
		$Y is the year number yyyy.
		$w is the week day.
		$W is the week number.
		$d is the date yyyymmdd.
		$t is the time hhmmss.
		$T is the long date and time.

	Redirection Section	:
		$I is redirection (<)
		$O is redirection (>).
		$A is redirection (>>).
		$P is redirection (|).

	Use WDX Section	:
		$! is the begin/end delimiter for calling content plugin using super_wdx.
		the syntax is the same as super_wdx  :
		   $! Field:%fieldName@wdxAddon.wdx%  Name:%name@filesys.wdx%$!
		the syntax to use super_wdx column is :
		   $!nnn$! call SUPER_COLUMN #nnn (from 1 to 999)
		this feature is experimental and does not support languages :(

	To use a $ in a command, use $$ instead.

	All expression containing $[fpnxz] are automatically quoted (if -q is not set).

	[Option] one (d|e|E|p)? and q? and i/I? and codepage number? (to force CP):
		'q' do NOT quote parameters(for long file name)
		'd' debug only !
		'e' edit
		'E' edit using the tcblEdit.bat file.
		'p' pause before execution !
		'i' signal usage of TCBL.INI file.
		'I' signal usage of aternate ini file.
		'n' null option for filename starting with "-"))

	--------------------------------------------------
	INI FILE definition

	You can use $1 to $9 as parameters inside <pre>,<cmd>,<end> commands.
	[CmdName]
		The section for the command CmdName

	;  any comment you want to add.....
		This is a line used for commenting your script.
		It is not kept in the final script !

	pre=command for initialization
		This is a line used for initialization script !
		You can have as much <pre> command as you like!

	cmd=command for each file
		This is a line used and repeated for each entry file !
		You can have as much <cmd> command as you like!
	   cmd=<xxx|yyy>command for each file with extension like xxx or yyy
	   cmd=<z:A.*Z>command for each file with fileName starting with "A" end ending with "Z"
	    Syntax : <('Topic' : )?'Regular Expression'>
		'Topic' is optionnal and can be one of 'f' 'p' 'e' 'z' see File Section
		The default 'Topic' is the filename extension
		'Regular Expression' is a standard C Extended Regular Expression (ignoring case).

	end=command for finalization
		This is a line used for finalization script !
		You can have as much <end> command as you like!

	You can have 0 to n 'initialization line' 
	plus 0 to n 'command line'
	Plus 0 to n 'finalization line'.
	For more info see the TCBL.ini sample file


-----------------------------------------------------
Sample (1): tcbl -d .\FileList.lst type $f $AallFiles.txt
Sample (2): tcbl -eq .\FileList.lst ren $f $n.not_used
Sample (3): tcbl -d1251 .\FileList.lst echo $z [$e] $A$p\SelectedFiles.txt
Sample (4): tcbl .\FileList.lst echo $$$z$$$e$$ 
Sample (5): tcbl .\FileList.lst copy $f $p\S1 $; copy $f $p\S2 $; ren $f $n.saved 
Sample (6): tcbl .\FileList.lst copy $f $p\$d_$c-$n
Sample (7): tcbl .\FileList.lst copy echo ---- START BATCH ---- $( echo the file is $n in $p )$ echo ---- END BATCH ----
Sample (8): tcbl -Ei .\FileList.lst IniCmd "Parameter 1" "%T" .
Sample (9): tcbl -I c:\totalcmd\tools\tcbl\imagik.ini .\FileList.lst IniRotateL "+45" "%T" .
Sample (10): tcbl -q.\FileList.lst @echo $f $!CRC32=%GetCrc32FromFile.NoBrackets@crc32tag.wdx%  Size=%size.bytes@filesys.wdx%b last_access=%accessdate@filesys.wdx%$!  $; @echo Desc=$!%Description@FileDesc.wdx%$! >details.txt


TcblEdit.bat file contain the command for launching your alternative editor !
If tcbl is used from TotalCmd Button/command, filelist.lst is <<%L>> !

Enjoy and use the bat builder/launcher !

To use From Total Commander,

use %L parameter to get the list of selected files  (Long File Name)  
use %l parameter to get the list of selected files  (8.3/11 File Name) 

Create a new toolbar button 

TC) Sample : create a "Copy of " Files :
	Command : TCBLnch.exe
	parameter : %L copy $f "$p\Copy of $n"

TC) Sample : create rotated images (With ImageMagick)
	Command : TCBLnch.exe
	parameter : %L mogrify -rotate 90 $f

TC) Sample : create a reduced images (With ImageMagick)
	Command : TCBLnch.exe
	parameter : %L convert -resize 50% $f $x_small.$e

TC) Sample : add ".inactive" at the end of a file	
	Command : TCBLnch.exe
	parameter : %L ren $f $n.inactive

TC) Sample : remove the extension of a file	
	Command : TCBLnch.exe
	parameter : %L ren $f $z

TC) Sample : unzip all selected file into a target folder
	Command : TCBLnch.exe
	parameter : %L unzip $f -d %T 

TC) Sample : Compress exe and dll
	Command : TCBLnch.exe
	parameter : %L upx -9 $f 
....
( Tips : 
If you want to use file found by the File search, open the result page (Show list), select all files and use the created button )    
....	
	


Download new version 0.83(include super_wdx)

Download only programm update 0.83

Download (old) 0.6b version