Under the the following key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control
Create a new key called StorageDevicePolicies. In that key create a new DWORD value called WriteProtect and set it to 1.
This is known to work under Windows XP SP2, though you can try it on your other varioations of Windows.