Hi ,
I'm Dyari. Thanks for reaching out. I will be happy to assist you in this regard.
Some external hard drives have a physical switch to enable/disable write protection. Make sure this switch is set to allow writing.
Also, make sure you run the correct commands with Diskpart:
Diskpart
list disk
select disk X (Replace X with the number of your external disk)
attributes disk
attributes disk clear readonly
exit
Please let me know if you need further assistance and keep me updated.