I wanted to create a batch file that will enable or disable write protection. Basically, 2 batch files, one to enable and the other to disable write protection. I used to do it manually in CMD by using these commands.
Step 1: Start CMD In Administrater Mode
Step 2: Type Diskpart
Step 3: Type list volume
Step 4: Type select volume 5
Step 5: Type attributes volume set readonly OR attributes volume clear readonly
A batch file that does it will be much better but I have zero knowledge about that. I searched on the internet and managed to create a batch file that open up diskpart but couldn't go any further.
here's the code for that:
@ECHO OFF
Diskpart
PAUSE
Now, how do I make it to list volumes?