Компьютерный форум OSzone.net  

Компьютерный форум OSzone.net (http://forum.oszone.net/index.php)
-   Программное обеспечение Windows (http://forum.oszone.net/forumdisplay.php?f=7)
-   -   Добавление в контекстное меню (http://forum.oszone.net/showthread.php?t=317132)

mxm199 25-07-2016 12:27 2653921

Добавление в контекстное меню
 
Здравствуйте, товарищи
Понадобились мне тут URI-ссылки на файлы/папки, есть такая софтинка Lst2Clip (вообще позиционируется как плагин к ТС), экзешник+ключи, выглядит так
Команда: Lst2Clip.exe /P:"file:///" /R:"\"="/" /R:" "="%20"
Параметры: /L:"%L"
в Тотал добавил без проблем, на выходе в буфере оказывается URI-ссылка типа file:///, но никак не могу добавить в контекстное меню проводника, то есть пункт меню добавил, добавил по умолчанию команду с ключами, но как приклеить к Command на выполнение параметр /L:"%L", а без него софтина не фурычит.
Или подскажите другой метод получения ссылки.
Заранее спасибо!

mwz 25-07-2016 19:10 2654060

Цитата:

Цитата mxm199
пункт меню добавил, добавил по умолчанию команду с ключами, но как приклеить »

Покажите, как у вас сейчас выглядит строка, добавившая пункт в меню (экспорт ключа из реестра — вставка этой части ветви текстом).

mxm199 26-07-2016 10:46 2654184

Выглядит так

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\lst2clip]
@="Копировать ссылку файла"
"icon"="C:\\Program Files\\Lst2Clip\\Lst2Clip.exe, 0"
"position"="top"

[HKEY_CLASSES_ROOT\*\shell\lst2clip\command]
@="\"C:\\Program Files\\Lst2Clip\\Lst2Clip.exe\" /P:\"file:///\" /R:\"\\\"=\"/\" /R:\" \"=\"%20\""


Но параметр /L:"%L" вот куда приткнуть... Без него ругается, мол не определён "/L: has not been defined"

В мануале описаны ключи

UNC-path
/U converts paths of mapped drives into UNC network paths. This parameters is only required, if the network path is assigned to a local drive. If you access the network path directly, the parameter is not required. /U should be the first parameter.

No extension
/NE (no extension) Use this parameters to suppress copying of file extensions.

path depth
/PD (path depth) The path depth defines how many parts of a path will be copied. You can specify how many path parts will be copied at the beginning and at the end. The root is included in the count. Between these two parts ...\ is placed. Click here for a detailed example.

Prefix
/P Prefix, which will inserted before each line. Example: /P:"PRE"

Suffix
/S Suffix, which will be inserted after each line.. Example: /S:"POST"

Replacing string parts
/R is a parameter, which can be used multiple times. You may use it to replace parts of each line. In the following example all occurrences of "Righteous" will be replaced by "Lefteous" and all Occurrences of "12345" will be eliminated: Example: /R:"Righteous"="Lefteous" /R:"12345"="" Attention: Quotation marks should always be set as shown in the above example. String replacement is case sensitive.

/L The file list. /L must be the last parameter. The following values are possible:

%L Long file names including the complete path, e.g. c:\Program Files\Long name.exe
%l (lowercase L) Short file names including the complete path, e.g. C:\PROGRA~1\LONGNA~1.EXE
%F Long file names without path, e.g. Long name.exe
%f Short file names without path, e.g. LONGNA~1.EXE
%D Short file names including the complete path, but using the DOS character set for accents.
%d Short file names without path, but using the DOS character set for accents.
%P causes the source path to be inserted into the command line, including a backslash (\) at the end.
%T inserts the current target path. Especially useful for packers.


Приведен пример строки
Lst2Clip.exe [/u] [/NE] [/PD] [/RB] [/P] [/S] [/R] /L
но в таком виде
"C:\Program Files\Lst2Clip\Lst2Clip.exe" /P:"file:///" /R:"\"="/" /R:" "="%20" /L:"%L"
в буфер попадает первая строка содержимого файла

Iska 26-07-2016 13:47 2654239

mxm199, никак Вы её не приткнёте напрямую. Ибо не существует возможности задать в реестре параметр в виде «file list». Имена выделенных объектов можно передать только подряд в одну строку.

Я бы посмотрел в сторону JScript-скрипта, который будет получать переданные имена в командной строке, разбирать её на составляющие имена, кодировать посредством encodeURI() и, в отдельных случаях, помещать результат в буфер обмена.

mxm199 26-07-2016 16:51 2654292

Спасибо за внимание, вопрос закрыт, нашёлся качественный аналог Path Copy Copy

Iska 26-07-2016 17:17 2654297

mxm199, их как собак нерезаных :): FileMenu Tools.

serg515 12-02-2022 21:49 2979877

Link Shell Extension
Allway Sync
Default Programs Editor
Easy Context Menu
Toucan
FCorp Context Menu Manager
Ultimate Windows Context Menu Customizer
Synchredible
Winaero Context Menu Tuner


Время: 16:00.

Время: 16:00.
© OSzone.net 2001-