loading
I had the need to have a switch to turn read only mode for all my USB sticks (sadly only a old 128Mb one had a hardware switch). The use of SD and microSD cards with a adaptor (they both have a switch) is a option but only if your PC has a card reader. After some research i came up with a plan. And after some testing, and codeing i have made this litlle aplication that fit my needs.

UPDATED 17.09.2013

!!! I MESSED THE WINDOWS 7 COMPATIBILITY, SORRY FOLKS PLEASE USE A VERSION BEFORE 1.5.0.0 FOR VISTA+ SO !!!

Rewriten in Visual C++ 2008

Version: 1.5.0.0
Download: https://docs.google.com/file/d/0ByKfzUUEN5s-ZmRnZ19Gbk1vYXc/edit?usp=sharing
[File is in a 7zip archive www.7-zip.org]

Version 1.5.1.0
Download: https://docs.google.com/file/d/0ByKfzUUEN5s-Z2M4SndNNjFqN28/edit?usp=sharing
[File is in a 7zip archive www.7-zip.org]

Version 1.5.1.5
Download: https://docs.google.com/file/d/0ByKfzUUEN5s-anhaNEMzQ0hwXzQ/edit?usp=sharing
[File is in a 7zip archive www.7-zip.org]

Step 1: How it does what it does ?

It sets in the registry a dword value to 1 for "Read-Only Mode" and 0 for "Read-Write Mode".

Path:
HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control -> StorageDevicePolicies

Key
WriteProtect=1 or 0

I have added 2 registry files that enable or disable that, for learnig purpose.
<p>Very useful for me !!! Thanks</p>
Nice idea!<br>Here a little improvement that MAY work.<br>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor<br>Set this value to 4 to desactivate usb drive, then to 3 to activate again.<br><br>So, you could modify your app to:<br>Read only mode:<br>1) set to read-only<br>2) desactivate usb device (act like unplug)<br>3) activate usb device (act like re-plugging)<br>4) profit!<br><br>Normal mode:<br>1) set to normal mode (read/write)<br>2) desactivate usb device (act like unplug)<br>3) activate usb device (act like re-plugging)<br>4) profit!
Nice ideea, but registry editing on that key works only after restart, to simulate a unplug and a re-plug the only way i kow it can work it is with devcon.exe (Windows WAIK). This action has some steps : <br> <br>1. Get the device ID for all usb sticks pluged (automaticaly) <br>2. after registry write, disale, wait 1-2 seconds and enable all usb sticks pluged <br>3. I gonna work on this 2 get it working :D
Added all features you sugested. :)

About This Instructable

4,298views

24favorites

License:

More by neumanngregor:Web Scraping With Ruby Convert a HG658 Huawei Router to a Repeater How to repair Windows 10 recovery loop error without a reinstall 
Add instructable to: