T
T
Tech-GS2020-02-14 10:47:34
Command line
Tech-GS, 2020-02-14 10:47:34

How to substitute the name of the current directory in the command parameters?

Using Total Commander in the current directory, you need to create an archive from the selected files with the name of the current directory . There are no problems with the archiving team. How to get current directory name? Of the keys that exist in TC, there is only the full path to the file %P and the name of the current file %O.
An example of a command that creates an archive with the name of the current file :

Команда, создающая архив - "%COMMANDER_PATH%\AddOn\Arc\arj32.exe"
Параметры - a "%O.arj" %S

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2020-02-14
@res2001

Make the simplest batch file, in which there will be one of your commands. In the vehicle, call the batch file with the first parameter %P.
In the batch file, you can get the path to the directory from the passed parameter using the entry:

%~dp1
%~n1 - имя файла без расширения
%~x1 - расширение файла
%~f1 - полный путь к файлу

S
Sergey Pankov, 2020-02-14
@trapwalker

echo %cd%
but...arj? In 2020? Seriously?...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question