Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Win7
On win7 i set "nodrives" in registry,then send WM_SETTINGCHANGE refresh windows shell,I found the driver still exist(the driver icon become transparent ). if i restart explorer.exe process, it hide ok. Is there any method to hide drive at once without restart explorer ?
Posted 27-Dec-12 14:25pm
Edited 27-Dec-12 14:30pm
Sergey Alexandrovich Kryukov at 27-Dec-12 21:39pm
Why, why? Did you check up Harmony With Algebra? —Salieri1791 :-)
mozart1983 at 5-Jan-13 1:40am
Do you mean the Registry set wrong? I think it's not, because it good on restart explorer.
Sergey Alexandrovich Kryukov at 5-Jan-13 1:51am
I did not see your registry; hard to tell. —SA
mozart1983 at 5-Jan-13 3:56am
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer] "NoDriveTypeAutoRun"=dword:0000005f "NoSimpleNetIDList"=dword:00000001 "NoDrives"=dword:00000040

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

What would you mean by "still exists". I don't think this registry option really makes drives (when you wrote "driver" you probably meant "drive", right?) non-existing. It looks like it merely hides drives from the user of the Shell. Besides, the documentation describes that it is related only to drive letters. You can use a drive without a letter, as mounted to a directory. Please see:[^].
To certain extent, it explains why the effect is manifested when you restart the explorer. I would only note that it could be not just explorer, but any other file manager or just the application using Shell API.
Another method? To start with, I would question in what sense would you need to restring the drives (volumes)? Microsoft describes the behavior of "nordives", so, in the same way, you would need to describe the behavior you want, and, importantly, explain why. And sorry, I still cannot guarantee that I would be able to answer.
mozart1983 at 5-Jan-13 3:39am
First, thanks a lot! I want to hide dirve letters on windows shell without restart shell and can access it, this is for my company project requirement. Follow is my code: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer] "NoDrives"=dword:00000040 DWORD dwResult = -1; LRESULT hRet = ::SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, NULL, NULL, SMTO_BLOCK, 1000, &dwResult ); SHChangeNotify( SHCNE_UPDATEITEM, SHCNF_IDLIST, NULL, NULL ); SHChangeNotify( SHCNE_DRIVEREMOVED, SHCNF_PATH, "G:", NULL ); SHChangeNotify( SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL ); The result is: dirve ico become transparent status when refresh shell. I want to hide the drive letter immediately, invisible without restart shell. By the way, it is work good on Winxp.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 529
1 OriginalGriff 307
2 Damith Weerasinghe 295
3 ravikhoda 260
4 Tadit Dash 180
0 Sergey Alexandrovich Kryukov 10,974
1 OriginalGriff 6,667
2 Peter Leow 4,760
3 Abhinav S 3,813
4 Maciej Los 3,565

Advertise | Privacy | Mobile
Web03 | 2.8.140421.2 | Last Updated 5 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid