After the fall of Fascism, he was assigned to Busto Arsizio to command the 25th Bersaglieri Battalion, but abandoned the troops on 8 September at the news of the Armistice of Cassibile and reached Rome, where he joined the Republican Fascist Party.
On 25 October 1943, he ordered a roundup in the Santa Fiora area on Mount Amiata, aiming to capture some escaped British prisoners of war, which resulted in five arrests and the killing of farmer Pietro Nuti, accused of harboring the enemy.
Following the February 1944 decree, which provided for the death penalty for draft evaders and deserters, Ercolani began a zealous campaign of repression against those who did not respond to the call to arms of the Italian Social Republic and the families who assisted and sheltered them.
[2] One of the most notorious operations was the one at Monte Bottigli, organized by Ercolani himself, in collaboration with Deputy Commissioner Liberale Scotti and Fascist triumvir Silio Monti: on the night between March 21 and 22, eleven young men were captured and sentenced to death in a show trial at the rural school of Maiano Lavacchio.
In early July, he was appointed president of the National Agency for Assistance to Refugees and the Protection of the Interests of the Invaded Provinces (ENAP) of the Italian Social Republic, based in Milan, a position he held until the end of the war.