Click here to Skip to main content
Sign Up to vote bad
good
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:25
Edited 27 Dec '12 - 14:30

Comments
Sergey Alexandrovich Kryukov - 27 Dec '12 - 21:39
Why, why? Did you check up Harmony With Algebra? —Salieri1791 :-)
mozart1983 - 5 Jan '13 - 1:40
Do you mean the Registry set wrong? I think it's not, because it good on restart explorer.
Sergey Alexandrovich Kryukov - 5 Jan '13 - 1:51
I did not see your registry; hard to tell. —SA
mozart1983 - 5 Jan '13 - 3:56
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer] "NoDriveTypeAutoRun"=dword:0000005f "NoSimpleNetIDList"=dword:00000001 "NoDrives"=dword:00000040

1 solution

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:
http://technet.microsoft.com/en-us/library/cc938267.aspx[^].
 
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.
 
—SA
  Permalink  
Comments
mozart1983 - 5 Jan '13 - 3:39
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
Your Filters
Interested
Ignored
     
0 OriginalGriff 216
1 Sergey Alexandrovich Kryukov 169
2 Tadit Dash 154
3 Richard MacCutchan 145
4 Santhosh G_ 115
0 Sergey Alexandrovich Kryukov 10,338
1 OriginalGriff 7,965
2 CPallini 4,201
3 Rohan Leuva 3,522
4 Maciej Los 3,159


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