Microwave irradiation of a hydrazine and 3-methoxyacrylonitrile, ethoxymethylenemalononitrile or Et acetoacetate provides rapid access to 3- or 5-substituted pyrazoles in excellent yield and with total regiocontrol in a process that can be switched from one regioisomer to the other by choice of conditions.Subsequent reaction, either by microwave-assisted hydrolysis and cyclocondensation with formamide, Hantzsch-type three-component reaction with an aldehyde and ketone, or by cyclocondensation with 2-nitrobenzaldehyde, provides the pyrazolo[3,4-d]pyrimidine, pyrazolo[3,4-b]pyridine or pyrazolo[3,4-b]quinolin-4-one framework, resp., of inhibitors of mitogen-activated protein kinases.