简体   繁体   English

选择一个程序,Windows将按批处理文件打开具有特殊格式的文件

[英]Choose a program that windows will go open files with special format by batch-file

(sorry by the english) (对不起英语)

I have a app that uses the following command to open files: 我有一个使用以下命令打开文件的应用程序:

java.awt.Desktop.getDesktop().open(new File(caminhoArquivo));

the problem is that i uses a special format to open files (ex.: .TXZ), and if i don´t open the file before by SO and says that i want to open that file whit notepad, the app just give a Excption and don´t open.. 问题是我使用一种特殊的格式来打开文件(例如:.TXZ),如果我之前未通过SO打开文件并说我想打开该文件的记事本,则该应用程序只给出一个Excption并且不要打开..

I´m needing to install this by command like .bat, and add in the registry of windows that i want to open this files in format .XXX by notepad.. 我需要通过.bat等命令安装此文件,并添加Windows注册表,我想通过记事本以.XXX格式打开此文件。

Searching here, i found this examples: 在这里搜索,我发现了以下示例:

Key: HKLM\SOFTWARE\Classes\.TXZ
Value: <default> = “TXZ.Document”

Key: HKLM\SOFTWARE\Classes\TXZ.Document
Value: <default> = “TXZ Document”

Key: HKLM\SOFTWARE\Classes\TXZ.Document\DefaultIcon
Value: <default> = “[!notepad.exe],0?

Key: HKLM\SOFTWARE\Classes\TXZ.Document\shell\open\command
Value: <default> = “[!notepad.exe]” “%1?

and this: 和这个:

[HKEY_CURRENT_USER\Software\Classes\blergcorp.blergapp.v1\shell\open\command]
@="c:\path\to\app.exe \"%1\""
[HKEY_CURRENT_USER\Software\Classes\.blerg]
@="blergcorp.blergapp.v1"

but how is the first time that i uses something like this, i can´t do my .bat looking like this works.. someone can help me with one example? 但是我第一次使用这样的东西是怎么回事,我无法让我的.bat看起来像这样。.有人可以帮我举一个例子吗?

要使用记事本批量打开文件* .xxx,请使用assoc .xxx=txtfile txt文件(您知道* .txt使用记事本打开,您可以使用assoc .txt进行窥视)要“取消关联”,请使用assoc .xxx=

assoc .txz=TXZfile assoc TXZfile=TXZfile ftype TXZfile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"

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

相关问题 从批处理文件运行.jar - Run .jar from batch-file Java程序使用Windows Task Scheduler启动,但未在批处理文件夹中创建日志文件 - Java program started using windows task scheduler but not creating log files in batch file folder 使用Windows批处理文件启动Java程序 - Use Windows Batch File to start a Java program 默认情况下,“绑定”文件格式可使用Java程序打开 - “Binding” file format to open it with Java program by default Windows批处理文件wmic获取Java进程的PID,如何将标记设置为变量以测试PID是否存在? -如果没有启动,则提示重新启动 - Windows batch-file wmic to get PID of a java process, how do I set tokens to a variable to test if PIDs exist? - start if not,else prompt for restart 在不具有批处理文件的可运行Jar文件中使用JFX播放音乐 - Playing music using JFX in a Runnable Jar-file without batch-file Jar-File在控制台中运行,但是在由批处理文件执行时崩溃 - Jar-File runs in console, but crahes when executed by batch-file 如何在Windows批处理文件中获取Java程序的退出状态 - How to get the exit status of a Java program in Windows batch file 与Java的Windows批处理文件(或外部程序)进行通信 - Communicate with a windows batch file (or external program) from java MsgViewer(Java)不会打开.msg文件 - 批处理文件解决方案? - MsgViewer (Java) won't open .msg files - Batch file solution?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM