Create new folder and other question

Hi All,

Would anyone know if there is component that could create folder if it is not existed and using the name I specified? 
 
How could I let the program knows if I choose a file from a specific folder(ex ABC folder), then it should run the ABC_protocol. If I choose a file from XYZ folder then it would run the XYZ protocol.

Will appreciate any input!