简体   繁体   中英

MsgViewer (Java) won't open .msg files - Batch file solution?

I've just downloaded MsgViewer from here: https://sourceforge.net/projects/msgviewer/

I need it to be the default program for opening .msg files. It required Java JRE so I've installed the 64bit JRE on my 64bit Win2012R2 server.

Running MSGViewer.jar from the install folder and dragging/dropping a .msg file into it works just fine, so I created a file association between .msg and MSGViewer.jar. BUT now when I double-click a .msg file I get the dreaded blue bar error 'This app can't run on your PC' - despite it working fine when run manually.

I've been advised to create a batch file to handle this but after a lot of head scratching I can't work out how to do this successfully. Can anyone show me how to create a batch file that opens when a .msg file is clicked and opens that file in C:\\Program Files (x86)\\MSGViewer-1.9\\MSGViewer.jar ?

I've created a batch file containing: Java -jar MSGViewer.jar

And associated .msg files to it. Now clicking a .msg file opens MSGViewer but it opens blank and doesn't display the message. Any ideas of which command line options I could use to display the clicked msg file within MSGViewer when it opens?

Worked it out!

*.msg associated to batch file containing:

Java -jar MSGViewer.jar %1

"%1" being the magical answer.

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