How to send TC parameters to other apps?
Moderators: Hacker, petermad, Stefan2, white
How to send TC parameters to other apps?
Hello, all,
I'd like to send some useful parameters to other apps for some kind of sequential action.
Do you know how to achieve it?
For example, I need to get the current source path, copy it to another directory with Xcopy command, then compressed it and send it by outlook with winrar command line.
Currently I can only use two buttons to achieve it, because I don't know how to pass the source path to winrar command line.
But what I want is to integrate all the above actions to a single button on the button bar.
Pls. help.
Thx.
I'd like to send some useful parameters to other apps for some kind of sequential action.
Do you know how to achieve it?
For example, I need to get the current source path, copy it to another directory with Xcopy command, then compressed it and send it by outlook with winrar command line.
Currently I can only use two buttons to achieve it, because I don't know how to pass the source path to winrar command line.
But what I want is to integrate all the above actions to a single button on the button bar.
Pls. help.
Thx.
You have a lot of choices:
Here's a quick summary:
%P gives the full path (but not the filename)
%N gives the full file name with extension
%O gives filename ONLY (no extension)
%E gives the extension
%S gives the file names of all selected files
%L writes the full path and filename of all selected files to a temp file and passes the LOCATION of that temp file to the program.
lower case variations (e.g. %p, %n, etc.) use the DOS 8.3 alias convention
%T, %M, %R give the equivalent of %P, %N, %S but for the TARGET panel instead of the source panel.
The full list can be found in Help (F1), go to Index and type:
Dialog Box: Configuration: Change Button Bar.
Then scroll down the page to Parameters.
This should give you everything you need and more!
Here's a quick summary:
%P gives the full path (but not the filename)
%N gives the full file name with extension
%O gives filename ONLY (no extension)
%E gives the extension
%S gives the file names of all selected files
%L writes the full path and filename of all selected files to a temp file and passes the LOCATION of that temp file to the program.
lower case variations (e.g. %p, %n, etc.) use the DOS 8.3 alias convention
%T, %M, %R give the equivalent of %P, %N, %S but for the TARGET panel instead of the source panel.
The full list can be found in Help (F1), go to Index and type:
Dialog Box: Configuration: Change Button Bar.
Then scroll down the page to Parameters.
This should give you everything you need and more!
Thanks for your hint.AKE wrote:You have a lot of choices:
Here's a quick summary:
%P gives the full path (but not the filename)
%N gives the full file name with extension
%O gives filename ONLY (no extension)
%E gives the extension
%S gives the file names of all selected files
%L writes the full path and filename of all selected files to a temp file and passes the LOCATION of that temp file to the program.
lower case variations (e.g. %p, %n, etc.) use the DOS 8.3 alias convention
%T, %M, %R give the equivalent of %P, %N, %S but for the TARGET panel instead of the source panel.
The full list can be found in Help (F1), go to Index and type:
Dialog Box: Configuration: Change Button Bar.
Then scroll down the page to Parameters.
This should give you everything you need and more!
I know there are lot of parameters in help file, which are located in "Dialog box: Change start menu".
The only thing I concerned is that a single button can not excute two or more commands sequentially.
For example:
move %P%N D:/test
del %P%N
Thanks a lot for disclosuring the world's greatest secret.MVV wrote:I'll open a world's greatest secret to you: if you press F1 in buttonbar button's edit dialog, you'll see how to pass source path and many other useful things to application.
Also, you can call batch file instead of winrar directly so multiple commands may be executed via a single button.

I've try that already.
Just as I replied in previous post,
it seems hard to excute sequential commands in a single button.
Maybe batch is a good idea, I'll try it later.
But before I try it, I can imagine that there will be a black prompt window, How to avoid this?
By using nircmd to hide it? Seems not so good.
Is there any better idea?
fastrun,
HTH
Roman
Perhaps they could be chained using "&&"?The only thing I concerned is that a single button can not excute two or more commands sequentially.
For example:
move %P%N D:/test
del %P%N
HTH
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.
As far as I have tried, buttons launch an application either directly or via association. So windows shell commands don't work directly from a button -- there is no implict context to execute instructions within the cmd shell... for this reason I don't think chaining with && will help -- that's a technique for a batch script.
Batch scripts seems the way to go if you all you want to do is multiple commands. Batch arguments are now more flexible, not only %1, but also %~n1 and %~x1.
%1 references the first command line argument,
%~n1 references JUST the filename (without extension)
%~x1 references extension only, etc.
and there are more variations (see `help for` in cmd shell)
Batch scripts seems the way to go if you all you want to do is multiple commands. Batch arguments are now more flexible, not only %1, but also %~n1 and %~x1.
%1 references the first command line argument,
%~n1 references JUST the filename (without extension)
%~x1 references extension only, etc.
and there are more variations (see `help for` in cmd shell)
AKE, it is possible to use multiple commands in a single line:
But anyway batch file is more convenient.
Code: Select all
Command: cmd /c echo Hello World & pause
Code: Select all
Command: cmd /c
Parameters: echo Hello World & echo %P%N & pause
MVV wrote:fastrun, you can set 'Minimized' flag for that button so no black window will appear, just a taskbar button that will appear and then disappear (it is almost invisible w/o any third-party tools).
Thanks so much!MVV wrote:AKE, it is possible to use multiple commands in a single line:Code: Select all
Command: cmd /c echo Hello World & pause
But anyway batch file is more convenient.Code: Select all
Command: cmd /c Parameters: echo Hello World & echo %P%N & pause
Yes, you finished this task perfectly.
Thanks a again!
Find another method to avoid black prompt cmd window by using "nircmd", a very tiny powerful command line tool.
For instance:
you can use the following command in button bar to creat a new folder in the target window with current file name:
For instance:
you can use the following command in button bar to creat a new folder in the target window with current file name:
command: nircmd.exe
parameters: execmd MD "%T%O"
start path: %COMMANDER_PATH%\TOOLS\