Step 1. Click on Start->Cmd. Type
Diskpart and press enter.
Step 2. Type list disk .
Step 3. Type select disk 1 and this will select your Sdcard/Pendrive.
Step 4. Now type “ attributes disk clear readonly ” and press enter.
Now exit from cmd and format your Sdcard/USB Pendrive. This will remove write protection from your SD card or Pendrive.