Word sense disambiguation is one of the important challenges in natural language processing (NLP) and computational linguistics. However, preposition sense disambiguation especially, in Persian has been neglected. Therefore, the present study seeks to define an algorithm based on semantic frames to disambiguate the prepositions; «az», «dar», «ba» and «ta» in Persian. The algorithm and its implementation are new in this project. The data includes 1000 sentences as a training corpus, 100 sentences as a developing data and 500 sentences as a test data collected from internet sources and social networks such as YouTube. The mentioned prepositions were sense annotated. Semantic frames based on frame-based language (Minsky, 1975) were constructed for the mentioned prepositions in the training corpus and for the words before and after the prepositions included in the entries as a data file. The algorithm in three paths based on the information in the frames assigns a meaning to the prepositions in the sentences. The results indicated the high precision (99.16%) of the system in disambiguating the prepositions in Persian.