-1

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.

  • Any folder or a specific folder? Opened by any means (command or any application)? – fixer1234 Mar 31 '15 at 4:42
  • @fixer1234 I've edited my question. – jNerd Apr 1 '15 at 8:35
  • @Matthew Williams I've edited my question. – jNerd Apr 1 '15 at 8:36
  • You edited the part that was clear but didn't address the part that isn't. When any/all folder is opened or when a specific folder is opened? Opened by what? (any command? any application?) – fixer1234 Apr 1 '15 at 9:31
  • @fixer1234 I've again edited the question. Edited the part which was unclear. – jNerd Apr 1 '15 at 13:35
2

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
0

You can use third party software like Folder Actions, (something like Folder Actions in Macs). But that's probably not what you want. If you want to mimic the AutoPlay function for removable drives, you can Map folder to drive letter.

Not the answer you're looking for? Browse other questions tagged or ask your own question.