|www.rodneybeede.com||"I would love to change the world, but they won't give me the source code" - unknown|
There is still a window where ransomware could write to the drive, but this helps reduce the attack surface and has some potential for reducing impact.
It does require admin privileges (or UAC prompt) to use, but it has still been quite handy.
@REM Need to back B: drive writable diskpart /s "B:\Backup_Tools\make_drive_writable.diskpart"
diskpart /s "B:\Backup_Tools\make_drive_readonly.diskpart"
select disk=3 attributes disk attributes disk clear readonly attributes disk
select disk=3 attributes disk attributes disk set readonly attributes disk