Click on the "Start" button. Go to "Run", type "gpedit.msc" and press enter.
Wait for the "Group Policy" window to appear. Click on the "+" button beside User Configuration then click on the "+" button beside "Administrative Templates". Then click the "+" button beside "Windows Components" and then click "Windows Explorer".
Search for "Hide these specified drives in My Computer" in the options that appear in the right column of the window. Double click it, enable it and choose the drive(s) you want to hide.
Search for "Prevent access to drives from My Computer". Double click it and repeat the previous step if you want to stop accessing any drive by "command" (e.g, by typing "C:" in the address bar or "Run").
5Close the group policy window.
6Restart your computer for changes to take effect.
Wait for the "Group Policy" window to appear. Click on the "+" button beside User Configuration then click on the "+" button beside "Administrative Templates". Then click the "+" button beside "Windows Components" and then click "Windows Explorer".
Search for "Hide these specified drives in My Computer" in the options that appear in the right column of the window. Double click it, enable it and choose the drive(s) you want to hide.
Search for "Prevent access to drives from My Computer". Double click it and repeat the previous step if you want to stop accessing any drive by "command" (e.g, by typing "C:" in the address bar or "Run").
5Close the group policy window.
6Restart your computer for changes to take effect.