A mentally ill man who drove around throwing rocks at passing cars has been sentenced to a community order after admitting endangering road users.
Judge David Goodin said it was "remarkable" that nobody was killed as a result of 25-year-old Aaron Hurley's actions on the Norfolk-Suffolk border.
Norwich Crown Court was told that Hurley, of Langley, Norfolk, committed the offences between 25 May and 9 June.
The court heard Hurley was "frustrated" at failing to get treatment.
Hurley admitted at an earlier hearing four counts of endangering road users.
He also admitted three counts of causing criminal damage.
Martin Ivory, prosecuting, told the court that police examined Hurley's car when he was arrested in June this year.
"They found a 'bag for life' that contained 19 stones of various different sizes," he said.
One witness whose eight-year-old daughter was in the front passenger seat of his car, described hearing a "large bang" before his windscreen shattered, with his child suffering "minor cuts to the face".
Mr Ivory said: "This could have produced a situation where significant injury or fatality was caused. The danger is obvious."
He asked for 86 further matters to be taken into consideration.
Gavin Cowe, mitigating, said the offending was a manifestation of the defendant's schizophrenia and the "frustration of his mental mental health not receiving appropriate treatment at the time".
The court heard he was now receiving treatment.
Mr Cowe added Hurley had not been in trouble before.
Judge Goodin said: "It's almost incredible that nobody was more seriously hurt."
He sentenced Hurley to a three-year community order with a requirement to receive mental health treatment during this period.
He was also banned from driving for 12 months, ordered to pay an £85 victim surcharge and ordered to complete a 20-day rehabilitation activity requirement.
Mr Ivory said that damage totalling £17,000 was caused, based on information from 37 complainants, but "there are a good many more than that" and the true total could be triple the amount stated.
The Norfolk and Suffolk NHS Foundation Trust, which covers mental health care, said it was unable to comment on individual cases.