E.g., I could go to target directory of symbolic link with bat+cygwin:
wreadlink.bat gives path:
Code: Select all
@echo off
set PARAM=%1
REM escape double quotes!
set PARAM=%PARAM:"=\"%
bash -c "cygpath -m \"$(readlink -f %PARAM%)\""
Code: Select all
@echo off
for /f usebackq %%F in (`wreadlink "%1"`) do cd %%F
Sorry, I'm a total newbie with TC and in rather poor command of dos batch scripting, so thanks for any hint on subject.
Is there some way in TC to use output of a script in its CD command's params or to change directory in TC panel with cmd?
E.g., I could go to target directory of symbolic link with bat+cygwin:
wreadlink.bat gives path:
Code: Select all
bash -c "cygpath -m $(readlink -f %1)"
Code: Select all
for /f usebackq %%F in (`wreadlink "%1"`) do cd "%%F"
Sorry, I'm a total newbie with TC and in rather poor command of dos batch scripting, so thanks for any hint on subject.
UPD: solved!
I've find solution at stackoverflow (I can't post link, so google: 'how to open folder with an already running total commander in batch')
So, I've made new batch file as follows:
Code: Select all
for /f usebackq %%F in (`wreadlink "%1"`) do C:\totalcmd\TOTALCMD.EXE /O /T /S /R="%%F"
Code: Select all
/O If Total Commander is already running, activate it and pass the path(s) in the command line to that instance (overrides the settings in the configuration dialog to have multiple windows)
/T Opens the passed dir(s) in new tab(s) (for usage with /O)
/R= Set path right window
/S Interprets the passed dirs as source/target instead of left/right (for usage with /O).
Code: Select all
[em_ResolveSymlink]
cmd=%COMSPEC% /K
param=cd-slink-tc.bat "%P%N" && exit
menu=Resolve Symbolic Link to Dir in Opposite Panel
iconic=1