An efficient and divergent one-pot synthesis of substituted 2H-pyrans, 4H-pyrans and pyridin-2(1H)-ones from b-oxo amides based on the selection of the reaction conditions is reported. Mediated by N,N,N',N'-tetramethylchloroformamidinium chloride, b-oxo amides underwent intermolecular cyclizations in the presence of triethylamine at room temperature to give substituted 2H-pyrans in high yields, which could be converted into substituted 4H-pyrans in the presence of sodium hydroxide in ethanol at room temperature, or into substituted pyridin-2-