A simple route to 3-oxoalkanonitrile 5, a precursor of the title compounds is described. Reaction of enaminones 2 with hydroxylamine hydrochloride in ethanol yielded aldoximes 3 that were converted readily into 5 in basic medium. This method has been successfully applied with a number of substrates and resulted in excellent yields of the products. Reacting 5 with trichloroacetonitrile afforded 3-amino-2-aroyl-4,4,4-trichloro-2-butenenitriles 6 that condensed with hydrazines to yield 3-amino-1H-pyrazole-4-carbonitrile derivatives 8. Substituted pyrazolo[1,5-a]pyridmidines have been prepared with regioselective condensation reactions of 8 with nonsymmetrical dielectrophiles. The structures of compounds obtained were deduced based on 1H-NMR, 1H-15N HMBC- measurements.