Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com 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 stackoverflow.com/questions/412939/… –  CharlesB Apr 5 '11 at 10:17
add comment

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

share|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 ;)) –  Јοеу Apr 5 '11 at 11:13
add comment

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
add comment