Building on the theory of planned behavior, an ex ante and ex post survey was used to assess the impacts of elective and compulsory entrepreneurship education programs (EEPs) on students' entrepreneurial intention and identification of opportunities. Data were collected by questionnaire from a sample of 205 participants in EEPs at six Iranian universities. Both types of EEPs had significant positive impacts on students' subjective norms and perceived behavioral control. Results also indicated that the elective EEPs significantly increased students' entrepreneurial intention, although this increase was not significant for the compulsory EEPs. The findings contribute to the theory of planned behavior and have implications for the design and delivery of EEPs.