I've created a program that when opened displays a message. Now I want to do this - the program must automatically get executed when a folder in my PC is opened (opened by an user).
How can I do it? The folder can be any folder of my choice.
I don't believe you can do this natively.
However, you could possibly do it with something like AutoHotKey.
A number of possible approaches are outlined in this article. The best approach seems to be:
#Persistent SetTimer, test, 500 return test: IfWinNotActive, Create Event Log return sendinput test winwaitclose, Create Event Log return