Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Make a USB drive read only.

Is it possible to format a USB memory stick so that it cannot be formatted again?

What I actually need is to write software (using C# preferably) and then run that software on a specific PC when a USB memory stick is inserted to the USB port, and allow users copy files into the USB drive then somehow lock that USB drive so that it cannot be formatted or changed anymore!

I am not sure it is possible but I wonder if somebody has got any idea that it is achievable.

Thanks very much!

share|improve this question

migrated from Apr 5 '11 at 10:15

This question came from our site for professional and enthusiast programmers.

marked as duplicate by random Apr 5 '11 at 11:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

see… – CharlesB Apr 5 '11 at 10:17

You can 'lock' files on your flash drive. So when user tries to erase one of these he will get 'File is in use and cannot be deleted' error

share|improve this answer
This won't prevent formatting the drive, does it? – CharlesB Apr 5 '11 at 10:14
@Charles: Likely not, indeed, as formatting only requires a handle on the device, not a particular file (in fact, any file handles are probably quite invalid afterwards ;)) – Joey Apr 5 '11 at 11:13

Create a TrueCrypt virtual encrypted disk within a file on the drive.

Your data will be encrypted and unreadable and a password will be required to access it. The TrueCrypt software itself can be made available on the non-encrypted part of the disk.

share|improve this answer