A good yield in the stereospecific synthesis of S-vinylated mercapto groups in heterocycliccompounds is described involving the reaction of acetylenicesters and 2-mercapto-1-methylimidazole or 5-mercapto-1-methyltetrazole in the presence of pyridine. This one-pot method is simple and effective under mild conditions.