Energy companies pledged to have the final homes reconnected by last night after many people spent several days without electricity.
Scottish ministers have praised efforts to get the country’s transport and energy networks back to normal after this week’s severe storms.
Network Rail also completed repairs, including removing fallen trees from tracks.
Transport minister Keith Brown paid tribute to those who had worked around the clock to restore transport links and power supplies.
He said: “The task facing those involved with the clean-up operation on Tuesday and beyond was unprecedented, with hundreds of staff working day and night in very difficult conditions to get things back to normal as quickly as possible.
“Network Rail deployed more than 350 teams across the country to remove around 900 trees from lines and services are now running normally in most areas.
“The power companies mobilised an extra 600 workers, bringing the total number of engineers working to restore power to households to 1,550.
“Over the last four days, the number of people without power has reduced from 160,000 to 1,400 with an assurance from the power companies that all homes will have power by the end of the day.”
He said Scottish Hydro Electric Power Distribution (SHPD) and ScottishPower had also provided accommodation, hot meals and mobile catering facilities for those affected, while councils and police helped ensure the most vulnerable customers were kept safe and well.
The minister added: “I want to thank all those involved in the efforts for their unstinting hard work to repair the damage and look after those affected. I also want to thank all those people who were affected either by the travel disruption or the power cuts for their patience and understanding after one of the worst storms we’ve seen for a number of years.”
At the peak of Tuesday’s storm, members of the public were warned against travelling if their journey was not essential.
Gusts of 102mph were recorded at Blackford Hill in Edinburgh, with winds reaching 97mph in Bishopton.
At one stage, the entire island of Bute was without power and many households lost electricity for several days.
SHPD said last night 560 customers remained without power in Argyll and Bute, but all were expected to be reconnected.
Yesterday, ScottishPower had some 5,000 homes to reconnect but it also said all would be completed by last night. A spokesman said if a reconnection estimate for a property is expected to be later, the company will offer alternative accommodation or a generator.
Tuesday’s gales caused the most damage to the network in Central Scotland in 13 years, with the ScottishPower overhead network experiencing more faults in a single day than it would normally receive in three months.
Hundreds of electricity poles were broken and more than 1,000 trees and other debris have been removed.
The Royal Botanic Garden in Edinburgh said that during the storms more than 60 trees had been blown over and several lengthy polytunnels being used as tree nurseries were destroyed at its Benmore site in Argyll.