Health trusts across England were sent details of an IT security patch that would have protected them from the crippling ransomware attack, NHS Digital said.
Large swathes of the NHS have been paralysed by the cyber attack, which hit 200,000 victims in 150 countries around the world.
The health service has been rebuked for using the outdated Windows XP operating system to store digital information, despite security updates for the software having been discontinued by Microsoft.
The attack has left 47 NHS organisations affected with malware in their system, ranging from hospital trusts to commissioning support units.
Seven hospital trusts are still experiencing serious problems, among them St Bartholomew's Hospital in London, York Teaching Hospital NHS Trust and the University Hospitals of North Midlands Trust.
But NHS Digital said it had made health trusts aware last month of IT protection that could have prevented the attack.
It said in a statement: "NHS Digital issued a targeted update on a secure portal accessible to NHS staff on April 25, and then via a bulletin to more than 10,000 security and IT professionals on April 27 to alert them to this specific issue.
"These alerts included a patch to protect their systems. This guidance was also reissued on Friday following emergence of this issue."
Hospitals have stopped diverting patients following last week's cyber attack which crippled many NHS Trusts' IT systems.
A young computer expert from north Devon who was hailed a hero for helping to stop the global cyber attack said he was just "doing my bit".
One surgery has no access to medical records.