Write protection error mostly occur when a flash drive detect potential fault within itself. After this the drive goes into write-protected mode to avoid data loss. Follow the below mentioned solution to fix USB flash drive write protected error and restore your files:
You can try to plug the USB drive in another port of your computer or you can try to connect your drive into another PC and check your problem is solved or not. If not solved then try next solution.
Click Start. In the search box type Regedit. Now click on Regedit.exe to open Registry editor and then you have to navigate to the following:
You can see the WriteProtect value located in the right hand-pane of your Regedit.exe, just double click it. Now change the value of data from 1 to 0 and then click on OK to save it. Now exit from the Regedit and Restart your PC. I hope your problem will get solved.