I know this is an old one but questions about how to accomplish that are still showing up in the newsgroup once in a while.
The question is how to hide all local drives or some drives in the system that uses Explorer as the shell. Typically the question comes up on the way to lock down Explorer shell based embedded system.
The answer is simple - use Group Policy. There is a Group Policy exists that allows you to hide particular drives in My Computer folder of the system for specified user accounts. As with almost all Group policy settings, there is corresponding registry option that is doubled in global and per user branches:
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
Value Name: NoDrives
Data Type: REG_DWORD (DWORD Value)
The "NoDrives" value uses a 32-bit word to define local and network drive visibility for each logical drive in the computer. The lower 26 bits of the 32-bit word correspond to drive letters A through Z. Drives are visible when set to 0 and hidden when set to 1.
If your not happy working in Hex, add these decimal numbers to hide the drive(s):
A: 1, B: 2, C: 4, D: 8, E: 16, F: 32, G: 64, H: 128, I: 256, J: 512, K: 1024, L: 2048, M: 4096, N: 8192, O: 16384, P: 32768, Q: 65536, R: 131072, S: 262144, T: 524288, U: 1048576, V: 2097152, W: 4194304, X: 8388608, Y: 16777216, Z: 33554432, ALL: 67108863
For example to hide drive A and drive D, you would add 1 (A) + 8 (D) which means the value should be set to "9".
To disable all the drives set the value to "67108863".
The above only hide the drives in My Computer. Sometimes, however, preventing access to the contents of selected drives may work even better in a locked down OS. Then you'd want to use another registry value there - NoViewOnDrive. The same registry path both in HKLM and HKCU branches. Its value is structured the same way as the NoDrives's one.