简体   繁体   中英

How do I hide a custom drive with a registry key?

I am working on a project which creates a custom drive and is accessible under "This PC". The request is to hide the drive on a per-user basis using registry keys if possible.

The client machines are Citrix based on Windows Server 2008R2 but are being upgraded to 2016 shortly.

I know the GUID for the app which can be found in

HKLM\SOFTWARE\Classes\CLSID\{GUID}

I don't see anything obvious there which can hide the icon. I've also created the GUID at:

HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideMyComputerIcons\{GUID}

Which seems to only half work. It will hide the icon on the right pane however the navigation pane on the left still shows it. Restarting the pc didn't help to hide it.

Copy the "Attributes" value from "HKLM\\SOFTWARE\\Classes\\CLSID{GUID}\\ShellFolder", add the value of SFGAO_NONENUMERATED and set it as the "Attributes" value in " HKCU \\SOFTWARE\\Classes\\CLSID{GUID}\\ShellFolder".

(In Windows calculator, switch to programmer mode, enter the HKLM value, click OR( | ) and enter 1048576 to calculate the final attributes value)

If you are the author of this shell extension then you know if this is how your folder attributes are set or if they are set in IShellFolder::GetAttributesOf in which case you might need some custom code to allow hiding.

You might also want to add SFGAO_HIDDEN if non-enumerated is not enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM