I find the ChkBugReport to be very interesting: http://developer.sonymobile.com/knowledge-base/tools/analyse-your-bugreports-with-our-open-source-tool/
so I would like to use it on my Windows7 but in a simple way.
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
where the dumplog.txt is the log I want to analyze by the tool.
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.
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.
Is there a way to do this?
Run a Nonexecutable JAR with Arguments To run an application in a nonexecutable JAR file, we have to use -cp option instead of -jar. We'll use the -cp option (short for classpath) to specify the JAR file that contains the class file we want to execute: java -cp jar-file-name main-class-name [args …]
To do that, first, open a File Explorer window and locate your JAR file. Right-click your JAR file and choose Open With > Java(TM) Platform SE Binary. Tip: If you don't see that option in the “Open With” menu, then click “Choose Another App” and you'll see the option.
Follow these steps:
Open regedit (as administrator).
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
).
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).
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"
See also this tutorial.
(Works with my Windows 7)
The best answer above didn't work for me, it just opened a new window asking me what I'd like to open it with. I found a command that works much better. Same as first answer above but slightly different command (#4): cmd /k java
instead of java
. It runs it in a cmd window and the file is created in the current directory of the bug report.
Locate key HKEY_CLASSES_ROOT\*\shell
(Create shell key if it doesn't exist)
Right-click on the shell key, select New -> Key
. Enter the name of the command you'd like to display in the context menu (ie. Check Bug Report).
Right-click on the "Check Bug Report" key you just created and select New -> Key. Name it command
.
Click on the command key, double-click on the (Default) key in the right pane and enter the following command to be executed:cmd /k java -jar c:\PATH\Chkbugreport.jar "%1"
try add it to HKEY_CLASSES_ROOT*\shell
I use the following registry to add Notepad2 to the right-click content menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT*\shell\Notepad2] @="Notepad2"
[HKEY_CLASSES_ROOT*\shell\Notepad2\command] @="D:\Tools\Notepad2\Notepad2.exe %1"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With