Abstract: A vending machine for ice-cream and the like comprising: a batch-freezing unit that is capable of producing, inside itself, soft ice-cream and is provided with a valve assembly with a controlled opening and closing, through which the soft ice-cream can selectively flow out of the batch-freezing unit; a vessel-holding structure, which is adapted to temporarily support a portion vessel, placing it immediately beneath the valve assembly so as to collect the soft ice-cream that flows out of, and falls from, the valve assembly; and an electronic control device adapted to control at least said valve assembly; and a first detection device adapted to determine when the soft ice-cream coming out of the valve assembly touches the portion vessel stationary beneath the valve assembly; the electronic control device being adapted to control said valve assembly based on the signals coming from said first detection device.