简体   繁体   中英

Add an entry in right-click context menu and thereby running a java program

I am trying to invoke a java program by right clicking a file, which will use that file for some operation. The working should be such that, if i right click on a file, there should be present a menu item, such as "ClickMe". On clicking this, a java program should be invoked by passing the complete path of the file being clicked.

I tried something using REGEDIT. But, it doesn't work. What i used is :

HKEY_CLASSES_ROOT\\ * \\shell\\ClickMe\\Command default="C:\\Program Files\\Java\\jdk1.6.0_39\\bin\\java Test". (Test is the class name.)

But then, on clicking the ClickMe, an OpenWith window appeared.

I am stuck here. I would wonder if anyone just pull me out of this problem.

Thanks in advance.

Same here. I borrowed this answer , and used CMD to launch it instead:

cmd /c javaw -jar c:\tools\convert.jar --outfile converted.csv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM