Please help with this tricky situation.
The main objective is compile a directory location for the target tab based on a file in the source tab, but preserving the first 2 elements from the location of the target tab only in case it starts with \\\
I would like to integrate that in the menu
I have this batch file: loc.cmd
Code: Select all
@echo off
set /p loc=<%1.loc
echo %loc%
set destp=%2
echo %destp%
IF "%destp:~0,3%" == "\\\" (
FOR /f "tokens=1,2 delims=\" %%a IN ("%destp%") do SET base=%%a& SET srv=%%b
echo %base%
echo /R=\\\%base%\%srv%%loc%
%COMMANDER_EXE% /O /R=\\\%base%\%srv%%loc%
)
SET /p exit=Press any key to exit
Unfortunately it produces this output when ran from the TC DirectoryHotlist menu with params=%P %T
while I would expect to have these results, which are coming when I ran this from the CMD cliLOC= \home\navi\dir2\test3\
DESTP= \\\FTP\1.Ansible_11\home\navi\dir2\test3\
BASE=
TCopt= /R=\\\\\home\navi\dir2\test3\
Press any key to exit
I am totally lost... any other solution would also be appreciatedC:\totalcmd\myWork>c:\totalcmd\myScripts\loc.cmd C:\totalcmd\myWork\TC-batch-var-from-cmd-FAIL\ \\\FTP\1.Ansible_11\home\
LOC= \home\navi\dir2\test3\
DESTP= \\\FTP\1.Ansible_11\home\
BASE= FTP
TCopt= /R=\\\FTP\1.Ansible_11\home\navi\dir2\test3\
Press any key to exit