(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=