ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

SOLVED: Redirect clicks on files of a particular type to a *specific* single file?

(1/2) > >>

JavaJones:
I must now call upon the great DonationCoder wizards to help me pull off a birthday present for my girlfriend. :D

Quick version: I need a little utility that runs resident and lets me redirect clicks (or any "open" commands in the file manager) for *any* file of specific types (multiple types) to *one* specific file. In other words if someone clicks on bob.avi, john.mkv, or jo.mp4, I could redirect all of those to me.mov. I imagine doing it by setting file extension wildcards on a redirect list, e.g. "*.mkv, *.avi, *.mp4", etc. and then a field to set the file to redirect to. Also note: this need to work on Win 7.

Some background for why I need this: for the last several years my friends and I have made a tribute video to my girlfriend which we premiere at her birthday, generally to her surprise. This will be our 3rd video, so she's probably expecting it by now, and we want to try to keep it surprising. One of the dead giveaways is the big reveal moment, "hey, let's put a video on", but on this particular night we know she plans to watch some movies anyway. So my idea is to let her pick from the list of movie files on the computer, and she needs to be able to pick *any* movie so it's not obvious that we're rigging it, and then whatever she picks it actually opens the movie we have made.

Now the idea could be made broader, using complex naming wildcards or whatnot (i.e. more than just *). All I need is to match the file extension, but a more flexible tool would be more likely to have use for others.

And this does have possible functional use, albeit arguable. Let's say you have a computer that you let your kids use and you don't want to allow them to open and/or mess with important files, like system files (yes, protectable via "hide system files" in large part, but that's less convenient and selective). So you add *.SYS, *.DAT, etc. to the filter and turn the app on when you let them on the computer. If they try to open any of those files you can redirect to an app or word doc that says "sorry, you shouldn't be opening this" or whatever. Maybe protect the disable/exit of the app with a password. There are certainly other possible uses too...

Forgive me if this has already been done, or if the way to do it is obvious. All solutions and related info are appreciated.

- Oshyan

argv:
In this specific case it might be easier to replace the executable of the registered media player with some batch which will always run the same movie. Or to use image hijacking; take a look at "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"

f0dder:
IMHO the best route is simply redirecting the file extension(s) wanted to an app of your choice (keeping a reference to the old association, so you can uninstall later). This gets your app invoked when a file of the type is ShellExecute()'d; the simple version could simple run your hardcoded .mov with the old media player (either by hardcoding, or by "emulating" ShellExecute and parsing the old filetype association). More advanced version would would parse commandline, and take action depending on some config file.

If "Image File Execution Options" simply hijacks "mediaplayer.exe -> myhandler.exe", aren't you going to get into an infinite loop when "myhandler.exe" tries to use "mediaplayer.exe" to redirect *.mov -> "myfile.mov"? :)

argv:
If "Image File Execution Options" simply hijacks "mediaplayer.exe -> myhandler.exe", aren't you going to get into an infinite loop when "myhandler.exe" tries to use "mediaplayer.exe" to redirect *.mov -> "myfile.mov"? :)
-f0dder (January 24, 2010, 09:26 AM)
--- End quote ---

Good question :)

Shades:
Are there not some (portable) applications that manage extensions? That method would beat changing all extensions in registry and restoring them after-wards. IMHO nobody should be playing too much with the registry, especially when it isn't (absolutely) necessary. The suggested registry changes are easy enough to change, but still...

Here is a link to a freeware portable extension manager (actually: a program launcher) that might be doing all that you need.

Edit:
found a link to a DC thread about Portable Extension Manager (PEM) as well

Navigation

[0] Message Index

[#] Next page

Go to full version