file-association

How do I associate a filetype with an icon?

血红的双手。 提交于 2019-11-29 07:58:01
I have written preview handlers for a couple custom file types. These file types don't have an application by default that can open them. I want to associate an icon with the file types as a signifier that they are custom. I have tried setting a registry entry for DefaultIcon in HKCR\.<filetype> , but it doesnt appear to work, even after reboots. I do these registry modifications from C#, and the modifications are successful. The icon file is simply an ico file residing in %APPDATA% for the moment. I plan to add a few more icons, and put these in a dll file. I just want to get it to work

How to change file association programmatically without require elevation

孤人 提交于 2019-11-29 07:48:28
How to change file association programmatically when the user does not have admin/elevated rights (Win XP, Vista, 7)? Any ideas about how to work around this? Basically I would like to keep my application as lite as it is now (it doesn't need elevated rights to install and run). At the moment I offer a GUI interface where the user can change the file association, but if the user has limited rights all it does is to show a message that it cannot do that and it explains to it how to activate the "Run this program as administrator" box then restart the program. If the user has the rights, then I

Running Python script from command line opens script in the default text editor instead of executing script

感情迁移 提交于 2019-11-29 07:11:09
I have files with .py extension associated with Python interpreter. However when I type name of such a file at the command line and press ENTER the file is being opened in the default text editor (Notepad++) instead of being run with the associated Python interpreter. Why? Z:\1>where python c:\Program Files\Python\2.7\python.exe Z:\1>reg query HKCR\.py /ve HKEY_CLASSES_ROOT\.py (Default) REG_SZ Python.File Z:\1>reg query HKCR\Python.File\shell\open\command /ve HKEY_CLASSES_ROOT\Python.File\shell\open\command (Default) REG_SZ c:\Program Files\Python\2.7\python.exe "%1" %* Z:\1>echo %PATHEXT%

Perl on Windows, file associations and I/O redirection

偶尔善良 提交于 2019-11-29 04:36:30
Can someone explain the difference between calling a perl script via file association versus calling the same script explicitly via perl.exe ? Apparently I/O redirection doesn't work very well when the script is called via file association, and I would really like to know why. E.g. take a look at the Activestate FAQ for Perl on Windows . The cat file example works perfectly as long as the script doesn't receive its input via redirection. So cat file.txt works as expected, but whoami | cat.pl does not. Not only is the .pl extension needed, but apparently the output of whoami isn't piped into

Cross-platform way to open a file using Java 1.5

…衆ロ難τιáo~ 提交于 2019-11-29 03:53:41
I'm using Java 1.5 and I'd like to launch the associated application to open the file. I know that Java 1.6 introduced the Desktop API , but I need a solution for Java 1.5 . So far I found a way to do it in Windows: Runtime.getRuntime().exec(new String[]{ "rundll32", "url.dll,FileProtocolHandler", fileName }); Is there a cross-platform way to do it? Or at least a similar solution for Linux ? OscarRyz +1 for this answer Additionally I would suggest the following implementation using polymorphism: This way you can add new platform easier by reducing coupling among classes. The Client code:

How do you change file association for .py Python files in XP?

試著忘記壹切 提交于 2019-11-28 21:56:15
When I type assoc .py I get .py=py_auto_file . When I type ftype py_auto_file I get py_auto_file="C:\Program Files\Adobe\Photoshop 7.0\Photoshop.exe" "%1" How do I make py_auto_file="C:\Python27" ? It appears Photoshop may recognize a .py file format and has associated "py_auto_file" with the .py extension. You can use the following command to locate the python file types: C:\>ftype | findstr -i python Python.CompiledFile="C:\Python27\python.exe" "%1" %* Python.File="C:\Python27\python.exe" "%1" %* Python.NoConFile="C:\Python27\pythonw.exe" "%1" %* The next command shows the correct

Add a new file association in Windows 7 [closed]

折月煮酒 提交于 2019-11-28 18:40:08
With Windows XP I could use the Control Panel to add a new file extension, associate it with a program, and assign an icon to it. I did that using Folder Options in the Control Panel. Folder Options has a tab in it called "File Types". But Windows 7 Folder Options does not have that tab. And the suggested place for file associations (Default Programs) does not let me add a new extension. How do I do what I want to (i.e. associate a new extension with an existing program and also apply a new icon to it)? Mario Unfortunately it's one of those things they made more complicated in an attempt to

Associate file type with Java Swing application

纵饮孤独 提交于 2019-11-28 12:22:30
I am creating a java swing application and I need to set the my program as the default program for the file extension .mcsd (MIME type text/mcsd ). This must work on windows, and it would be nice if it worked on OS X/Linux as well. I am somewhat new to java (3 or 4 months) so please don't bombard me with all kinds of expert talk. I have seen associating a custom file extension with java app in windows , but I would prefer not to use the Java Web Start. If possible, I would also like to know how to set the icon of that file type. I have found exe4j as a way of creating the .exe and plan to use

How to change file association programmatically without require elevation

自作多情 提交于 2019-11-28 01:23:02
问题 How to change file association programmatically when the user does not have admin/elevated rights (Win XP, Vista, 7)? Any ideas about how to work around this? Basically I would like to keep my application as lite as it is now (it doesn't need elevated rights to install and run). At the moment I offer a GUI interface where the user can change the file association, but if the user has limited rights all it does is to show a message that it cannot do that and it explains to it how to activate

File association in Inno Setup

戏子无情 提交于 2019-11-27 19:08:05
I am using Inno Setup and am trying to associate a program that is located in the Program Files (x86) in Windows 7. I have the following: #define MyAppName "MyView" #define MyAppExeName "MyView.exe" [Setup] AppName={#MyAppName} [Registry] Root: HKCR; Subkey: ".mpl"; ValueType: string; ValueName: ""; ValueData: "MyView"; Flags: uninsdeletevalue Root: HKCR; Subkey: "MyView"; ValueType: string; ValueName: ""; ValueData: "MyView"; Flags: uninsdeletekey Root: HKCR; Subkey: "MyView\delta.ico"; ValueType: string; ValueName: ""; ValueData: "{app}\GeoView.EXE,0" Root: HKCR; Subkey: "MyView\shell\open