windows 如何将多个文件名传递给上下文菜单 Shell 命令?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6440715/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 17:08:31  来源:igfitidea点击:

How to Pass MULTIPLE filenames to a Context Menu Shell Command?

windowsshellcontextmenuregistry

提问by WinWin

Passing a single filename to a context menu shell command is simple:

将单个文件名传递给上下文菜单 shell 命令很简单:

[HKEY_CLASSES_ROOT\*\shell\MyProgram\Command]
@="program.exe %1"

But if I select multiple files, program.exeis invoked for eachsuch selected file.

但是如果我选择多个文件,program.exe则会为每个这样选择的文件调用。

What I would like to do instead is invokeprogram.exeonly once, passing to it all the filenames currently selected.

我想做的是program.exe只调用一次,将当前选择的所有文件名传递给它。

How to do this?

这该怎么做?

采纳答案by Eternal Learner

You may want to look at this post, as it says that this isn't really possible to pass multiple files to a single instance and you must rely on some form of IPC(Inter process Communication).

你可能想看看这篇文章,因为它说这真的不可能将多个文件传递给一个实例,你必须依赖某种形式的 IPC(进程间通信)。

回答by W4ldi

You can use Send Tofor this. It supports multiple files.

您可以为此使用发送到。它支持多个文件。

In case this website goes offline:

如果本网站离线:

Open shell:sendtowith Windows + Ror paste it into your explorer address bar. It should redirect you to:

打开shell:sendtoWindows + R或粘贴到你的资源管理器的地址栏。它应该将您重定向到:

C:\Users\<yourusername>\AppData\Roaming\Microsoft\Windows\SendTo

C:\Users\<yourusername>\AppData\Roaming\Microsoft\Windows\SendTo

Create a shortcut to your program in this folder and you should see it in your explorer right-click menu under Send to

在此文件夹中创建程序的快捷方式,您应该在资源管理器的右键单击菜单下看到它Send to