|
|
|
By editing the Registry it is possible to change the icon that Windows Explorer uses for a drive. For example, if you want to change Drive E's icon, create the following registry key:
HEKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Explorer\DriveIcons\E\DefaultIcon\
When you create the above key, a string value named "Default" with value not set is automatically created. What you have to do is setting this value with the path of the icon, and this changes the drive icon of Drive E.
If you want revert back the default Icon, just delete the value of the "Default" string value, or just delete the above registry key. Here are two reusable routines to set or reset the icon for a specified drive: |
Click here to copy the following block | Sub ChangeDriveIcon(ByVal driveLetter As String, ByVal icoPath As String) Dim regKey As String regKey = "Software\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\" & _ driveLetter & "\DefaultIcon" CreateRegistryKey HKEY_LOCAL_MACHINE, regKey SetRegistryValue HKEY_LOCAL_MACHINE, regKey, "", icoPath End Sub
Sub ResetDriveIcon(ByVal driveLetter As String) Dim regKey As String regKey = "Software\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\" & _ driveLetter & "\DefaultIcon" DeleteRegistryKey HKEY_LOCAL_MACHINE, regKey End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|