/build/static/layout/Breadcrumb_cap_w.png

How can I associate .java files to a particular program

Via the command line, or script. I would like .java files to open in a program called textpad instead of notepad. Also is it possible to change the Icon in windows explorer to match the program it is associated to?

0 Comments   [ + ] Show comments

Answers (3)

Posted by: captain_planet 13 years ago
Black Belt
0
To do it properly (i.e, using the 'TextPad.java' ProgId) , here's the registry which you require (If you're using Textpad 5, of course):

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.java]
@="TextPad.java"
"PerceivedType"="text"
[HKEY_CLASSES_ROOT\TextPad.java]
@="Java Source File"
"EditFlags"=dword:00000000
"BrowserFlags"=dword:00000008
[HKEY_CLASSES_ROOT\TextPad.java\DefaultIcon]
@="C:\\Program Files\\TextPad 5\\TextPad.exe,0"
[HKEY_CLASSES_ROOT\TextPad.java\shell]
@=""
[HKEY_CLASSES_ROOT\TextPad.java\shell\edit]
[HKEY_CLASSES_ROOT\TextPad.java\shell\edit\command]
@="\"C:\\Program Files\\TextPad 5\\TextPad.exe\" -s"
[HKEY_CLASSES_ROOT\TextPad.java\shell\edit\ddeexec]
@="[open(\"%1\")]"
[HKEY_CLASSES_ROOT\TextPad.java\shell\edit\ddeexec\application]
@="TextPad.5.0"
[HKEY_CLASSES_ROOT\TextPad.java\shell\edit\ddeexec\topic]
@="System"
[HKEY_CLASSES_ROOT\TextPad.java\shell\open]
[HKEY_CLASSES_ROOT\TextPad.java\shell\open\command]
@="\"C:\\Program Files\\\\TextPad 5\\TextPad.exe\" -s \"%1\""
[HKEY_CLASSES_ROOT\TextPad.java\shell\print]
[HKEY_CLASSES_ROOT\TextPad.java\shell\print\command]
@="\"C:\\Program Files\\TextPad 5\\TextPad.exe\" -s -p \"%1\""
[HKEY_CLASSES_ROOT\TextPad.java\shell\printto]
[HKEY_CLASSES_ROOT\TextPad.java\shell\printto\command]
@="\"C:\\Program Files\\TextPad 5\\TextPad.exe\" -s -pt \"%1\" \"%2\" \"%3\" \"%4\""


You can either save it into a .reg file and import it like so:
REG IMPORT C:\TextpadJavaRegistry.REG (or do it using Regedit.exe - s etc)

Or you can write it via a VBScript. And there are TONS of VBScript registry-writing scripts out there....[;)]
Posted by: clivebuckwheat1 13 years ago
Purple Belt
0
thanks man will give it a go. Question the regkey works perfect, but textpad resides in C:\Program Files(x86) it's on a windows 7 x64 machines where the problems resides. I guess I have to change all instances of C:\Program Files\ to C:\Program Files(x86) ?
Posted by: captain_planet 13 years ago
Black Belt
0
Yeah.....or try using the %ProgramFiles(x86)% environment variable instead......
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ