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!

link|improve this question
feedback

migrated from stackoverflow.com Apr 5 '11 at 10:15

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

closed as exact duplicate by random Apr 5 '11 at 11:59

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

2 Answers

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

link|improve this answer
1  
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
feedback

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.

link|improve this answer
feedback