[英]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.