Follow the step below:
- Go to start menu and open run shortcut(Winkey+R)
- Type in gpedit.msc
- Click on Administrative templates
- Then double click on windows components.
- Double click on windows explorer
- Open prevent access drives from my computer
- Now enabled it and select the drives below that you want to lock. then click apply then ok.
- The drives has been locked
- If you want to unlock it then click on not configured then click on apply then ok.
- The drives has been unlocked
Drop your comment if you encounter any issue