Tech blog to share information.

June 25, 2010

Drive Icon Changer Script

June 25, 2010 Posted by tj cool No comments
Simply copy paste the following script in notepad and save with extension .vbs

On Error Resume Next
Dim WSHShell, p, strDrive, strIcon
strDrive = Inputbox("Enter the drive letter you wish to change the icon for:","Enter Drive Letter","X")
If strDrive = "" Then
End If
strIcon = Inputbox("Enter the path to the icon wanted:","Enter Drive letter","")

If strIcon = "" Then
End If

Set WSHShell = WScript.CreateObject("WScript.Shell")
p = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\"& strDrive & "\DefaultIcon\"
WshShell.RegWrite p, strIcon
Set WshShell = Nothing
MsgBox "You must log off/log on, or end process on Explorer.exe for the changes to take effect.", 4096,"Finished"

Happy Programming......