Search code examples
c++windowswdk

How to hide a device in explorer


I would like to create a functionality for hiding a device, such as a DISK ON KEY, under explorer (for instance making E drive invisible).

I should emphasize I only want to HIDE the device (or drive letter) under my computer, and not entirely unmount it. just so the user does not see it.

How do I programmatically do this, without forcing a restart or killing explorer for the change to take effect?


Solution

  • The easiest solution is to unassign the drive letter: DeleteVolumeMountPoint("E:\").