通过鼠标右键单击Windows执行带有参数的.jar文件? [英] executing .jar file with an argument by mouse right-click on Windows?

查看:168
本文介绍了通过鼠标右键单击Windows执行带有参数的.jar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现ChkBugReport非常有趣:
http://developer.sonymobile.com/knowledge-base/tools/analyse-your-bugreports-with-our-open-source-tool/

I find the ChkBugReport to be very interesting: http://developer.sonymobile.com/knowledge-base/tools/analyse-your-bugreports-with-our-open-source-tool/

所以我想在我的Windows7上使用它,但是以一种简单的方式。

so I would like to use it on my Windows7 but in a simple way.

为了使用这个工具在jar中,我需要在命令提示符下键入以下内容:

In order to use the tool that is in jar, I need to type the following in the command prompt:

java -jar ChkBugReport_ver.jar dumplog.txt

其中dumplog.txt是我想要通过该工具分析的日志。

where the dumplog.txt is the log I want to analyze by the tool.

事情是,它非常无聊运行cmd然后每次我想使用它时键入java -jar ... blah blah ..所以我想将它链接到Windows资源管理器中的鼠标右键单击上下文菜单。

The thing is that it is quite tiresome to run cmd and then type "java -jar... blah blah.." everytime I want to use it so I would like to link it to the mouse right-click context menu in Windows Explorer.

即浏览到我想要在Windows资源管理器中分析的文件,然后右键单击它将提供上午enu喜欢运行ChkBugReport ..然后它执行java -jar ChkBugReport_ver.jar clicked-file.txt并生成输出。

i.e., browse through to the file I want to analyze in Windows Explorer, then right-clicking on it would provide a menu like "run ChkBugReport.." then it does the "java -jar ChkBugReport_ver.jar clicked-file.txt" and generates the output.

有没有办法这样做?

推荐答案

请按照以下步骤操作:


  1. 打开注册表(以管理员身份)。

  1. Open regedit (as administrator).

找到键 HKEY_CLASSES_ROOT \ * \ shell 。如果您只想为特定扩展程序添加上下文菜单,请使用例如 HKEY_CLASSES_ROOT\.xml\shell for xml 。如果 shell 键不存在,请创建它(右键单击父键并选择 New - > Key )。

Locate key HKEY_CLASSES_ROOT\*\shell. In case you want to add the context menu for a specific extension only, use e.g. HKEY_CLASSES_ROOT\.xml\shell for xml. If the shell key doesn't exist, create it (right-click on the parent key and select New -> Key).

右键单击 shell 键,然后选择新 - >关键。输入上下文菜单中显示的命令的名称,例如检查错误报告

Right-click on the shell key, and select New -> Key. Enter the name of the command displayed in the context menu, e.g. Check Bug Report.

右键单击检查错误报告键并选择新增 - >关键。输入文本命令(小写)。

Right-click on the Check Bug Report key and select New -> Key. Enter text command (in lowercase).

单击命令键,然后双击右窗格中的(默认)键以编辑字符串值。输入要执行的命令。参数的占位符是%1 。对于 ChkBugReport_ver.jar ,您可以使用

Click on the command key and then double-click on the (Default) key in the right pane to edit the string value. Enter the command to be executed. Placeholder for the argument is %1. For ChkBugReport_ver.jar, you can use

java -jar "C:\Path\To\ChkBugReport_ver.jar" "%1"


另见本教程

(适用于我的Windows 7)

这篇关于通过鼠标右键单击Windows执行带有参数的.jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆