如何获取上下文菜单选择的路径?

发布于 2024-07-21 00:21:22 字数 198 浏览 7 评论 0原文

我在 Internet Explorer 的上下文菜单上有一个自定义条目。 我想对所选项目执行一些操作,例如,运行一个接收该选择作为 ARGV[1] 的程序。

例如,如果我右键单击桌面上名为 whatever.zip 的文件,则应运行以下内容: my_binary 路径\to\desktop\whatever.zip

I have a custom entry on the Internet Explorer's context menu. I would like to do something with the selected item, for example, run a program that receives that selection as ARGV[1].

For example, if I right click on a file named whatever.zip that is located on my desktop, the following thing should run :
my_binary path\to\desktop\whatever.zip

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紫罗兰の梦幻 2024-07-28 00:21:22

您需要更改 YOUR_BINARY 和文件类型来执行某些操作:

创建一个名为 RegisterYourBinary.reg 的文件,其内容为:

REGEDIT4

[HKEY_CLASSES_ROOT\.zip]
@="zipfile"

[HKEY_CLASSES_ROOT\zipfile\shell\DoSomething]

[HKEY_CLASSES_ROOT\zipfile\shell\DoSomething\command]
@="YOUR_BINARY \"%1\""

You need change YOUR_BINARY and the filetype to do something:

Create a file called RegisterYourBinary.reg with the content:

REGEDIT4

[HKEY_CLASSES_ROOT\.zip]
@="zipfile"

[HKEY_CLASSES_ROOT\zipfile\shell\DoSomething]

[HKEY_CLASSES_ROOT\zipfile\shell\DoSomething\command]
@="YOUR_BINARY \"%1\""
巴黎夜雨 2024-07-28 00:21:22

调用可执行文件时,从资源管理器上下文菜单中添加 %L 作为参数。
例如:
myApp.exe %L

add %L as argument from within the explorer context menu when calling your executable.
For example:
myApp.exe %L

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文