Previous work has shown that selectivity of product formation in the dissociation of a polyatomic molecule can be enhanced through the application of a pair of ultrashort laser pulses separated by a controlled delay. For the practical application of this Tannor-Rice scheme for selective photochemistry, the effects of changes in the laser temporal pulse shapes must be understood. To this end, we treat here the effects of pulse shaping for the Tannor-Rice scheme as applied to simple diatomic molecules. Since the molecular dynamics of diatomic systems are considerably simpler than those for polyatomics, the detailed effects of the laser pulses can be easily examined. Two systems of practical interest have been studied: (1) molecular I2, and (2) a van der Waals complex of Hg and Ar. Optimal control theory is used to generate a pulse shape which provides enhanced reaction yield. Results of constrained optimizations which limit the laser pulses to experimentally achievable shapes are also reported. These results demonstrate the importance of pulse shaping in the enhancement of selectivity of product formation in a chemical reaction. They also show that achievable approximations to the optimum pulse shape provide valuable enhancement of the product yield.