简体   繁体   English

MsgViewer(Java)不会打开.msg文件 - 批处理文件解决方案?

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

I've just downloaded MsgViewer from here: https://sourceforge.net/projects/msgviewer/ 我刚刚从这里下载了MsgViewer: https ://sourceforge.net/projects/msgviewer/

I need it to be the default program for opening .msg files. 我需要它作为打开.msg文件的默认程序。 It required Java JRE so I've installed the 64bit JRE on my 64bit Win2012R2 server. 它需要Java JRE,所以我在我的64位Win2012R2服务器上安装了64位JRE。

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. 从安装文件夹运行MSGViewer.jar并将.msg文件拖放到它中工作得很好,所以我在.msg和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. 但是现在当我双击一个.msg文件时,我得到了可怕的蓝条错误'这个应用程序无法在你的电脑上运行' - 尽管它在手动运行时工作正常。

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 ? 任何人都可以告诉我如何创建一个单击.msg文件时打开的批处理文件,并在C:\\ Program Files(x86)\\ MSGViewer-1.9 \\ MSGViewer.jar中打开该文件?

I've created a batch file containing: Java -jar MSGViewer.jar 我创建了一个批处理文件,其中包含:Java -jar MSGViewer.jar

And associated .msg files to it. 和相关的.msg文件。 Now clicking a .msg file opens MSGViewer but it opens blank and doesn't display the message. 现在单击.msg文件会打开MSGViewer但它会打开空白并且不显示该消息。 Any ideas of which command line options I could use to display the clicked msg file within MSGViewer when it opens? 我可以使用哪些命令行选项在MSGViewer打开时显示单击的msg文件?

Worked it out! 工作了!

*.msg associated to batch file containing: * .msg与批处理文件相关联,包含:

Java -jar MSGViewer.jar %1 Java -jar MSGViewer.jar%1

"%1" being the magical answer. “%1”是神奇的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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