简体   繁体   中英

Changing default program for a file type (workaround)

I would like to specify that images of a certain type (for example, .png) open by default in a program I've written when the file is contained in a certain directory. I've seen by searching ( Change Default Program for a specific folder ) that this is not possible on Windows 7 or 8.

I am saving these images in this directory myself, so I have some leeway with how I name the files. For example, I could change the filename a bit... perhaps to be example.myprog.png or something similar. Is there a way to set it up so files that match this filename pattern get opened, while other .pngs (in other directories) still open in the default viewer?

I don't really want to name these PNG images example.myprog (ie, fully change the extension), because when the user is browsing the directory in Windows Explorer, I would like the thumbnail images to still show up. Also, users will be eventually transferring these images to their own machines, where they'll want to use standard image viewers to look at them.

If this is not possible, does anyone have another suggestion for how to tackle this problem?

As you are mentioning that files should be opened in a program that you have written, try to change the code of your program to read files from the specific folder. So, by opening your program from anywhere in your pc, you should be able to open files from specified folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM