Two years ago, I asked a question at superuser.com about how to make an external storage partition read-only when giving my external disk to someone else. My aim was to prevent accidental deletion or modification of my files and folders by my friends or by viruses on their computers. This seems a very reasonable request to me, so I beleive some software-based solution should exist.
Some answers to my question suggested hardware-based solutions while some others beleive that no globally-valid software solutions can exist.
But, a recent comment pointed me to an older answer of another question which is exactly what I need. Although my question is 2-years old, the provided information is still useful. Because I like to automate everything to reuse, I started to write a PowerShell script for this task. Actually this is my first PowerShell scripting experience. I choose PowerShell instead of classic batch scripting because of my recent pains.
Here is the PowerShell script for those find it useful: