Utilizing the tandem reaction of aldehydes and ketones with hydroxylamine hydrochloride in the presence of triphosgene to construct nitriles and amides, respectively, we successfully have applied the practical protocol in the wide scope of substrates with diverse functional groups even including biomass-derived aldehydes and ketones in excellent conversions and yields. Among them, the nitrile prepared from vanillin can be used as a precursor for the synthesis of capsaicin. As a comparison, the conversion of oximes exhibits slightly inferior when directly reacting with triphosgene. More importantly, a plausible mechanism was proposed that the reaction undergoes deprotonation or rearrangement process and the one-pot reaction from aldehydes as precursors was found to be more applicable than the conversion of oximes to nitriles.