Reputation: 181
What I would like to do is make it so that when a folder is opened (or when the windows folder explorer is opened), either a program/batch file/etc. will run. I have no idea how I could do something like this, so any help and assistants will be greatly appreciated! Thank you.
Upvotes: 2
Views: 2786
Reputation: 1
There was an undocumented way to create an executable namespace object, and trigger/launch it via a GUID from inside the desktop.ini file.
I cannot recall how this was done, and the info seems to have vanished from the web, probably because the feature was used to create malware.
I also recall, that there was a way to hijack the handle to any running window, and run rogue stuff inside it. I saw a movie inserted to play inside a notepad window.
Upvotes: 0
Reputation: 3230
This is just an idea (but more than a comment could handle).
Windows allows you to attach a thumbnail provider, which will generate thumbnails for files. That's how softwares such as Microsoft Office, LibreOffice, VLC etc. make explorer thumbnails for files.
You can use this API and define a thumbnail provider for a file type invented by you, and put an empty file of that type in your folder. When the user opens the folder, your code will be run to generate the thumbnail, it can thus start another program (the one you want to start) and return a failure code (so that no thumbnail is cached, and the code will be re-run when the user re-opens the folder.
This only works starting from Windows Vista.
Upvotes: 2