Dragging mulitple files to a button mystery

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Spiderkeys
Junior Member
Junior Member
Posts: 53
Joined: 2015-04-07, 10:02 UTC

Dragging mulitple files to a button mystery

Post by *Spiderkeys »

This has been mystery for me for quite some time.

I put the same command (Shortcut, batch file or EXE) on the TC Button bar, and also drag the same command (filename) to the desktop.

When dragging a single file to the command, both work as they should, but when it comes to dragging multiple files to the command, the desktop processes all files as expected, but TC only processes the first file, and ignores the rest of my requests.

So wondering, is there some way to make a TC command behave the same way as the desktop, (hopefully without any extra plugins).
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

I don't know what you do and how you set up the commands,
but while modifying an button, press the F1-key and read the help.
Especially about the %S parameter.


Or for a batch use %F or %L
and in the batch %1 to access and then process each line of that temp file.


 
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Spiderkeys,
Basically, you don't drag files to a button in TC. You select them and click the button. Which files are processed and how is controlled by the Parameters field of the button.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Spiderkeys
Junior Member
Junior Member
Posts: 53
Joined: 2015-04-07, 10:02 UTC

Post by *Spiderkeys »

Hmm I guess we all having a different way of doing commands, it works perfect for single files, but so far tried %1, %*, and all of Stefan2's examples, still just processes only the first selected file and not the others.

And wow didn't know you could select files and then just press button, behaves differently but it's not helping as yet.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Here's a batch template I'm using to handle multiple files.
Put it on a button with parameter:

Code: Select all

"%L" "%P" "%T"

Code: Select all

@echo off
setlocal enabledelayedexpansion
rem Button Parameter "%L" "%P" "%T"
set tc_lst=%1
set tc_src=%2
set tc_dst=%3

echo %0
echo TC file list:   %tc_lst%
echo TC source path: %tc_src%
echo TC dest path:   %tc_dst%
echo(

	if x%3==x echo First parameter must be filelist path, second and third - source and target path. && pause && goto :EOF
	for /F "usebackq delims=" %%I in (%tc_lst%) do (
	
	rem ============== Insert your custom commands here ==============
	rem ---- Use delayed expansion for normal variables (!var! instead of %var%) to avoid collisions with special characters like ")"	
	
	echo Variable:		%%I
	echo Expanded: 		%%~I
	echo Full Path:		%%~fI
	echo File Name:		%%~nxI
	echo Drive:			%%~dI
	echo Path:			%%~pI
	echo File Name w/o Ext.:	%%~nI
	echo Extension:		%%~xI
	echo ShortPath:		%%~sI
	echo Attrb:			%%~aI
	echo Date Time:		%%~tI
	echo Size:			%%~zI
	echo ----------------------------
	set concat=%concat% %%~nI
	set concatdelayed=!concatdelayed! %%~nI
	
	rem ==============================================================
)
echo %concat%
echo %concatdelayed%
pause
cls
endlocal
Post Reply