(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 S.O. and says that i want to open that file whit notepad, the app just give a Excption and don´t open..

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..

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?

有帮助吗?

解决方案

in batch to open files *.xxx with notepad, use assoc .xxx=txtfile (you know, that *.txt opens with notepad and you can peek with assoc .txt) To "un-assoc" use assoc .xxx=

其他提示

assoc .txz=TXZfile
assoc TXZfile=TXZfile
ftype TXZfile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top