'代码出处:http://hi.baidu.com/gxhackji/item/8696f4e1d9adec14595dd84b
Private Sub Command1_Click()
Dim url As String
Dim Reg
url = Text1.Text '这个就是你的图标的地址
Set Reg = CreateObject("wscript.Shell") '修改注册表实现劫持图标
Reg.RegWrite "HKEY_CLASSES_ROOT\EXEFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.EXE\", "EXEFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\TXTFile\DefaultIcon\", url '劫持 txt 后缀的图标 下面其他的都一样
Reg.RegWrite "HKEY_CLASSES_ROOT\.TXT\", "TXTFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\RARFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.RAR\", "RARFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\ZIPFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.ZIP\", "ZIPFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\jpgFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.jpg\", "jpgFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\gifFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.gif\", "gifFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\bmpFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.bmp\", "bmpFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\batFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.bat\", "batFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\lnkFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.lnk\", "lnkFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\dllFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.dll\", "dllFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\ocxFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.ocx\", "ocxFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\datFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.dat\", "datFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\iniFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.ini\", "iniFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\logFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.log\", "logFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\tmpFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.tmp\", "tmpFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\wavFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.wav\", "wavFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\MP3File\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.MP3\", "MP3File"
Reg.RegWrite "HKEY_CLASSES_ROOT\wmaFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.wma\", "wmaFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\nlsFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.nls\", "nlsFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\CSSFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.CSS\", "CSSFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\PNGFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.PNG\", "PNGFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\INFFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.INF\", "INFFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\SRCFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.SRC\", "SRCFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\AVIFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.AVI\", "AVIFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\oldFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.old\", "oldFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\PRXFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.PRX\", "PRXFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\ManifestFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.Manifest\", "ManifestFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\SYSFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.SYS\", "SYSFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\MSCFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.MSC\", "MSCFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\XMLFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.XML\", "XMLFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\HTMFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.HTM\", "HTMFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\ASPFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.ASP\", "ASPFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\VBSFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.VBS\", "VBSFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\SCRFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.SCR\", "SCRFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\RATFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.RAT\", "RATFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\IMEFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.IME\", "IMEFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\CMDFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.CMD\", "CMDFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\REGFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.REG\", "REGFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\htmlFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.html\", "htmlFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\bakFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.bak\", "bakFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\swfFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.swf\", "swfFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\rdpFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.rdp\", "rdpFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\catFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.cat\", "catFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\dbFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.db\", "dbFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\chmFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.chm\", "chmFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\wmvFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.wmv\", "wmvFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\mhtFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.mht\", "mhtFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\frmFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.frm\", "frmFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\ctxFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.ctx\", "ctxFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\ctlFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.ctl\", "ctlFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\basFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.bas\", "basFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\vbpFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.vbp\", "vbpFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\vbwFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.vbw\", "vbwFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\sccFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.scc\", "sccFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\ocaFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.oca\", "ocaFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\frxFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.frx\", "frxFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\muiFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.mui\", "muiFile"
Reg.RegWrite "HKEY_CLASSES_ROOT\midFile\DefaultIcon\", url
Reg.RegWrite "HKEY_CLASSES_ROOT\.mid\", "midFile"
End Sub