In the below screenshot I have showed the drives connected to my computer, total I have 4 drives which you can see.
Now let’s check how to hide a drive from being visible. Just hit Run, in run just type regedit, when regedit opens, just navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer, after you are in explorer, in right hand side pane just right click, on clicking you will get menus, click new and DWORD (32-bit) Value and name it as NoDrives as you can see in below screenshot images for reference.
For eg to hide D: Drive you will need to enter 8 in that key, same as I have entered. After entering the value just click on OK and restart your computer. After restarting you will see that drive have been gone hidden.
Now to bring back you drive you will need to delete that DWORD (32-bit) Value key or you may also set 0 value which will bring drives to normal.
You can Hide Drives easily with this instructions in Windows XP, Windows Vista, Windows 8, Windows 7 and Windows Server, normally this will work in all versions of windows.