The law, launched on Thursday, bans the sale of any food or drink, from fruit and bottled water to Coca-Cola and Mars Bars, via automatic vending machines.
Schools have been disabling machines on their premises for the last few months so as to comply with the new rule, which was originally passed a year ago.
Supporters have maintained that the ban would help to tackle France's growing child obesity problem by reducing kids' access to junk food. Around 16 per cent of French children are now believed to be overweight or obese and figures have doubled in the last 15 years.
But some believe the new law goes too far.
"A total ban is never a good idea," said Nicolas Guermont, head of Selecta France, the country's biggest vending machine distributor.
Guermont, whose business will inevitably lose money, said that banning all vending machines regardless of what they served was not the solution. He said that more should be done to educate children on how to follow a balanced diet, and that the government had not listened to alternative proposals to allow machines selling healthier products.
In June this year, some members of the ruling UMP party tried to get the law amended so as to allow machines providing healthy alternatives that could be given prior approval on a state list. The proposals were rejected as industry lobbying.
The French vending machine association, NAVSA, also said a survey it commissioned in January showed that three quarters of parents with kids in Lycées opposed the removal of machines offering hot drinks.
France's food standards body, AFSSA, supported the ban as part of wider measures. It said in a statement that it was in favour of banning vending machines to discourage snacking, yet more action was needed to improve the nutritional value of school meals.
Some schools have followed AFSSA's advice by installing drinking fountains to supply refrigerated water for pupils. Others have complained that the 8,000 or so vending machines in schools across the country offer their hosts vital sources of income.
The French ban is one of the most extreme actions taken by a government in the name of the war on obesity.
The law itself begins only a few weeks after the American Beverages Association, backed by PepsiCo and Coca-Cola, introduced a voluntary ban on all drinks except water and 100 per cent juice in elementary schools, and all full-calorie soft drinks in middle schools in the US.
The British Soft Drinks Association, unsurprisingly, said it supported this policy over a total vending machine ban.
And a more hands-off approach to school vending machines was last year adopted by the UK's Food Standards Agency. It released advice for schools on how to set up and run machines offering healthier product selections, but has so far not moved to ban all machines.
The French government, however, has chosen to act faster and harder. Its ban on school vending machines came as part of a package on public health regulations, including plans to fine food producers who advertised 'junk food' without placing a health warning in the advert.
Calls for bans on vending machines in schools have still been seen in some other western nations, including as Ireland, the US and the UK. Some US states have banned fizzy sodas in middle and elementary schools, while California has just passed legislation to extend this ban to high schools.
The World Health Organisation says that 22m children under 5-years-old are obese worldwide, while the number of obese children aged between six and 17 has more than doubled in the last 40 years.
The British Medical Association, representing about three quarters of UK doctors, said that if current trends continue, at least one fifth of boys and one third of girls in Britain will be obese by 2020.
In terms of market value, children's products contribute about €14-15bn to the overall €700bn food and drink market in Europe.