Process for the recovery of Co or Ni, comprising the steps of:preparing a metallurgical charge comprising Fe, slag formers, and a useful load containing either one or both of Co and Ni;feeding the charge to a shaft furnace; andsmelting the charge so as to form a Co or Ni-bearing alloy, an Fe-bearing slag and a gaseous phase,characterised in that the useful load comprises at least 30 wt. % electrochemical batteries or their scrap, and in that the redox potential in the furnace is chosen so as to slag at least 20 wt. % of the Fe, and at most 20 wt. % of the Co or 20 wt. % of the Ni present in the charge.