How to pass param one by one to a program

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
bbbslayer
Junior Member
Junior Member
Posts: 14
Joined: 2009-11-11, 00:31 UTC

How to pass param one by one to a program

Post by *bbbslayer »

I make a button with command:

mklink /J %T%N %P%N

The command can create a folder symbolic link.

I need create many folders symbolic link. like mklink /J %P%S %T%S, but mklink only support a file name as param.

My wish is:
1. select many folders in tc
2. for a folder in select folders:
mklink %T/folder %N/folder
this is a loop expression

I met a software can do the job, but I can't remember its name, someone can help me?
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Try this tool. I have List2Str with similar (but not the same) capabilities. I can find it neither on wincmd.ru, nor totalcmd.net. If you want, I can email it to you.
Single user license #329241
PowerPro scripts for Total Commander
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Use a batch .cmd, like Script: MultiFileOpen.cmd
Modified for junction purposes:
Create a button:
Command: cmd.exe /c "C:\Location\of\TCmklink.cmd"
Params: %P %T %S
Put this in a file, TCmklink.cmd

Code: Select all

@ECHO OFF 
CLS 

:: SET Source=%~1
:: SET Target=%~2

:_LOOP 
  IF "%~3"=="" GOTO:EOF
  mklink /j "%~2%~3" "%~1%~3"
  SHIFT /3
  GOTO:_LOOP 
To use, select Folders you want to create junctions for, and click the button.
User avatar
nsp
Power Member
Power Member
Posts: 1958
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: How to pass param one by one to a program

Post by *nsp »

bbbslayer wrote:I make a button with command:

mklink /J %T%N %P%N

The command can create a folder symbolic link.

I need create many folders symbolic link. like mklink /J %P%S %T%S, but mklink only support a file name as param.

My wish is:
1. select many folders in tc
2. for a folder in select folders:
mklink %T/folder %N/folder
this is a loop expression

I met a software can do the job, but I can't remember its name, someone can help me?
As suggested, you can use lst2multi, the script of Balderstrom or you can use tcbl.
TCBL is TC Bat Builder and launcher, you can get it here !
the command could be :

Code: Select all

program: tcbl
parameter -q %L mklink /J "%T\$n" "$f"
icon: Whatever you want
bbbslayer
Junior Member
Junior Member
Posts: 14
Joined: 2009-11-11, 00:31 UTC

Post by *bbbslayer »

Thank you for everyone's help.
Finally I choose TCBL
TCBL can solve my problem.
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

Can anyone help me in creating a solution that includes executing an elevated version of cmd.exe?
User avatar
MVV
Power Member
Power Member
Posts: 8713
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Lefteous, you may use my micro tool Sudo to start an elevated process.
User avatar
nsp
Power Member
Power Member
Posts: 1958
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

Lefteous wrote:Can anyone help me in creating a solution that includes executing an elevated version of cmd.exe?
using * at beg of program TC launch with admin right.

Code: Select all

program:*%COMSPEC%  /k
parameter: cd %P
You can additionally use if you want any other elevate, sudo,.... tools
Post Reply