Transfer dir with user defined drive
Moderators: Hacker, petermad, Stefan2, white
Transfer dir with user defined drive
I am looking a command which transfer directory under cursor to the target panel but with user definded drive. I am daily synchronising D drive (source) and removable F drive (target) and consider the following situation.
1. I am already now D:\folder1\subfolder1 in left panel
2. I would like to have target or right panlel with folder F:\folder1\subfolder1
There is command cm_TransferLeft and cm_TransferRight, but it would be nice if we can transfer directory with user defined drive. However if the folder or user defined drive does not exist then it should work like normal cm_TransferLeft or cm_TransferLeft.
BTW, Why do we need the commands cm_TransferLeft or cm_TransferRight because the commands Target=Source does the same by simply activating rigth or left panel.
Thanks
1. I am already now D:\folder1\subfolder1 in left panel
2. I would like to have target or right panlel with folder F:\folder1\subfolder1
There is command cm_TransferLeft and cm_TransferRight, but it would be nice if we can transfer directory with user defined drive. However if the folder or user defined drive does not exist then it should work like normal cm_TransferLeft or cm_TransferLeft.
BTW, Why do we need the commands cm_TransferLeft or cm_TransferRight because the commands Target=Source does the same by simply activating rigth or left panel.
Thanks
1- Switch to D:\ in left panel and to F:\ in right panel1. I am already now D:\folder1\subfolder1 in left panel
2. I would like to have target or right panlel with folder F:\folder1\subfolder1
2- Execute cm_SyncChangeDir command
now each time you open a folder in Left or Right panel it will be opened in the other panel if it is contain a folder with the same name
cm_TransferLeft opens the folder or archive under the cursor in the right panel, but if the cursor is on a file, executing it will be looks like Target=SourceBTW, Why do we need the commands cm_TransferLeft or cm_TransferRight because the commands Target=Source does the same by simply activating rigth or left panel.
I am aware of this command. But my concern is that if we are already in some folder and would like to have same folder in another panel but in different drive without going back to root drive on both panels.1- Switch to D:\ in left panel and to F:\ in right panel
2- Execute cm_SyncChangeDir command
now each time you open a folder in Left or Right panel it will be opened in the other panel if it is contain a folder with the same name
Thanks.
- ghisler(Author)
- Site Admin
- Posts: 50865
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Consider using an automatic command line tool for daily operations, like xcopy or CmdSync from
http://www.fileware.co.uk
http://www.fileware.co.uk
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
2sujanlal
you could call SYNCOPEN together with a previously saved configuration name,
including the two starting dirs.
Can be used in starter menu, as button, or in a user defined command.
If the starting directory is always the same and you only need this for synchonizing,I am daily synchronising D drive (source) and removable F drive (target)
you could call SYNCOPEN together with a previously saved configuration name,
including the two starting dirs.
Can be used in starter menu, as button, or in a user defined command.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
No. I am daily (almost) synchronizing but with different folders each day.If the starting directory is always the same and you only need this for synchonizing, you could call SYNCOPEN together with a previously saved configuration name, including the two starting dirs.
Let me elaborate my situation in another way. I am now in some folder "A" in D drive in left panel. How can i open same folder "A" in F drive (it exists in F drive) in the right panel with single click?
Synchronize tool of TC is very convenient for me, so i do not want other tool.Consider using an automatic command line tool for daily operations, like xcopy or CmdSync from
http://www.fileware.co.uk
Thanks.
2sujanlal
After some testing: this should be your solution:
This will open F:[current panel's path] in the opposite panel,
then start TC's synchronize tool.
---
If the synchronize tool doesn't need to be started automatically,
you can reach this easier, without external tools:
---
[OT]: For synchronizing with a network share
(opens cm_FileSync with \\192.168.100.1\F\Tools for local directory F:\Tools,
"em_SyncSamePathNetDrive"):
Maybe someone finds this useful, too...
[Edit:]
Added missing double quotes around "%P" and "%%COMMANDER_PATH%%" -
and in em_SyncSamePathNetDrive removed the auto-generated ones from %%d.
After some testing: this should be your solution:
- Download TCStartWithCommand 2.0 (discussion in a german thread).
- Copy TcStartWithCommand.exe to your TC directory (where TOTALCMD.EXE is).
- Create a button or starter menu entry or user defined command
(I called it "em_SyncSamePathOtherDrive"):
Code: Select all
Command : %COMSPEC% /c
Parameters: for %%e in ("%P") do cd /d "%%COMMANDER_PATH%%" & start TCStartWithCommand.exe /O /S /R="F:%%~pe" /X="cm_FileSync"

then start TC's synchronize tool.
---
If the synchronize tool doesn't need to be started automatically,
you can reach this easier, without external tools:
Code: Select all
Command : %COMSPEC% /c
Parameters: for %%e in ("%P") do cd /d "%%COMMANDER_PATH%%" & start TOTALCMD.EXE /O /S /R="F:%%~pe"
[OT]: For synchronizing with a network share
(opens cm_FileSync with \\192.168.100.1\F\Tools for local directory F:\Tools,
"em_SyncSamePathNetDrive"):
Code: Select all
Command :
%COMSPEC% /c
Parameters:
for %%e in ("%P") do for /F "usebackq delims=: tokens=1" %%d in ('%%e') do cd /d "%%COMMANDER_PATH%%" & start TCStartWithCommand.exe /O /S /X="cm_FileSync" /R="\\192.168.100.1\%%~d%%~pe"
[Edit:]
Added missing double quotes around "%P" and "%%COMMANDER_PATH%%" -
and in em_SyncSamePathNetDrive removed the auto-generated ones from %%d.
Last edited by StatusQuo on 2008-01-11, 19:25 UTC, edited 2 times in total.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
2StatusQuo
Thank you very much for your suggestion. I tried with your second option
But this works perfectly if there is no space between folder. Could you or someone explain me how this commands works, is it dos command as i see blinking of dos window?
Another question- How can i define these commands as user defined command say "em_OpenSamePathOtherDrive" so that i can use shortcut for it.
Thank you very much for your suggestion. I tried with your second option
f the synchronize tool doesn't need to be started automatically,
you can reach this easier, without external tools:
Code:
Command : %COMSPEC% /c
Parameters: for %%e in (%P) do cd /d %%COMMANDER_PATH%% & start TOTALCMD.EXE /O /S /R="F:%%~pe""
But this works perfectly if there is no space between folder. Could you or someone explain me how this commands works, is it dos command as i see blinking of dos window?
Another question- How can i define these commands as user defined command say "em_OpenSamePathOtherDrive" so that i can use shortcut for it.
Read the beautiful Tuto…
2sujanlal
Hello !
KR
Claude
Clo

• You could give a glance HERE……How can i define these commands as user defined command say "em_OpenSamePathOtherDrive" so that i can use shortcut for it.

Claude
Clo
Last edited by Clo on 2008-01-11, 10:40 UTC, edited 1 time in total.
#31505 Traducteur Français de T•C French translator Aide en Français Tutoriels Français English Tutorials
2sujanlal
I updated the code above, thanks for reporting.
Now it should also work with paths containing spaces.
http://www.ghisler.ch/wiki/index.php/User-defined_commands
Available from NT (4.0?) up to Vista.
---
What it does:
Temporarily goes to TC install directory for running this.
This is the core:
This is normally used for loops, here it is needed to separate drive and path from the path name given by TC ("%%~pe" above).
More Infos can be found by typing "FOR /?" at the command line (cmd.exe).
Oops, TC doesn't add double quotes around %P.But this works perfectly if there is no space between folder.
I updated the code above, thanks for reporting.
Now it should also work with paths containing spaces.
Another description can be found atHow can i define these commands as user defined command say "em_OpenSamePathOtherDrive"
http://www.ghisler.ch/wiki/index.php/User-defined_commands
Yes, it is NT command line/batch code, an extended version of what was possible under DOS in earlier days.Could you or someone explain me how this commands works, is it dos command
Available from NT (4.0?) up to Vista.
---
What it does:
Code: Select all
for %%e in ("%P") do cd /d "%%COMMANDER_PATH%%" & start TOTALCMD.EXE /O /S /R="F:%%~pe"
Code: Select all
cd /d "%%COMMANDER_PATH%%"
Code: Select all
start TOTALCMD.EXE /O /S /R="F:%%~pe"
- It runs TC again,
- /O tells it to not open another window, but use the last active one.
- /S /R= specifies the path to be set in the inactive panel.
- "F:%%~pe": %%~p uses the path name (without drive information) of the given path from TC, which is stored in variable "e"
Code: Select all
for %%e in ("%P") do
More Infos can be found by typing "FOR /?" at the command line (cmd.exe).
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
Info: A bugfix-update to version 2.02 of TCStartWithCommand is available,
the download link can be found in the original thread.
the download link can be found in the original thread.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!