The isocyanic acid (HNCO) presents an extended distribution in the centers of the Milky Way and the spiral galaxy IC342. Based on the morphology of the emission and the HNCO abundance with respect to H2, several authors made the hypothesis that HNCO could be a good tracer of interstellar shocks. Here we test this hypothesis by observing a well-known Galactic source where the chemistry is dominated by shocks. We have observed several transitions of HNCO towards L1157-mm and two positions (B1 and B2) in the blue lobe of the molecular outflow. The HNCO line profiles exhibit the same characteristics of other well-known shock tracers like CH3OH, H2CO, SO or SO2. HNCO, together with SO2 and OCS, are the only three molecules detected so far whose emission is much more intense in B2 than in B1, making these species valuable probes of chemical differences along the outflow. The HNCO abundance with respect to H2 is 0.4-1.8 10^-8 in B1 and 0.3-1 10^-7 in B2. These abundances are the highest ever measured, and imply an increment with respect to L1157-mm of a factor up to 83, demonstrating that this molecule is actually a good shock tracer. Our results probe that shocks can actually produce the HNCO abundance measured in galactic nuclei and even higher ones. We propose that the gas phase abundance of HNCO is due both to grain mantles erosion by the shock waves and by neutral-neutral reactions in gas phase involving CN and O2. The observed anticorrelation of CN and HNCO fluxes supports this scenario. The observed similarities of the HNCO emission and the sulfured molecules may arise due to formation pathways involving also O2.