Run "diskpart"
Once in diskpart, run "list disk". Hopefully you can tell be the size which the correct disk is. If not, you can view details of each disk.
Now run "select disk x" where x is the number of the disk you want to check.
Now run "Attributes disk"
Check to see if the read only attribute is set.
If it is then you can use this command to clear that attribute:
Attributes disk clear readonly.
EDIT: If you really need to script this, let me know. I can do it, just don't want to spend the time if not necessary. After all, how often are you likely to need this? I would submit that it is easier to do this manually.