Not sure what you mean. Start a program when A GIVEN folder is eventually opened? Or EVERY folder!!?
What about when you casually browse that folder (passing through from a subfolder even)? Or when you right-click a short-cut and select open or explore? What about if other file-managers are used?
I'm not saying I'll be able to help you, but by helping you to be more specific you might be more likely to get expert help from someone else here...