Board logo

标题: [问题求助] [已解决]这个“IE工具栏增强→VBS版”代码有一点问题能不能改改 [打印本页]

作者: zhangop9    时间: 2011-12-21 09:28     标题: [已解决]这个“IE工具栏增强→VBS版”代码有一点问题能不能改改

本帖最后由 zhangop9 于 2011-12-21 09:43 编辑

http://www.cn-dos.net/forum/redirect.php?fid=23&goto=lastpost
IE工具栏增强→VBS版
  1. Dim WshSHell,FSO
  2. On Error Resume Next
  3. Set WshSHell = WScript.CreateObject("WScript.Shell")
  4. Set FSO = CreateObject("Scripting.FileSystemObject")
  5. Set WinVer = WshSHell.Environment("Process")
  6. Set Args = WScript.Arguments
  7. CloseTime = 8
  8. FileName = WScript.ScriptName
  9. FileFullName = WScript.ScriptFullName
  10. FilePath = FSO.GetParentFolderName(FileFullName)
  11. InsPath = FSO.GetSpecialFolder(1)
  12. InsFullName = FSO.BuildPath(InsPath ,FileName)
  13. LnkPathNT = WshSHell.SpecialFolders(2)
  14. LnkPath9X = WshSHell.SpecialFolders(14)
  15. LnkPathAll = WshSHell.SpecialFolders("Programs")
  16. OtherFileName="nircmd.exe"
  17. OtherFilePath=FSO.GetSpecialFolder(1)
  18. TemFileName="无标题"
  19. TemFilePath=FSO.GetSpecialFolder(2)
  20. Copyright="玲珑科技"
  21. QQ="QQ:25926183"
  22. Email="Email:fty1995@163.com"
  23. InsTitle="浏览器增强工具(IE版)"
  24. InsAnswer="浏览器增强工具(IE版)"
  25. MyShortcutFolder="快捷功能"
  26. MyShortcutName="显示所有IE窗口(Ctrl+Alt+Q).Lnk"
  27. MyShortcutHotKey="Ctrl+Alt+Q"
  28. RegPath1="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Extensions\"
  29. RegPath2=split("{D6E814A0-E0C5-11d4-8D29-0050BA6940E4}\,{D7E814A0-E0C5-11d4-8D29-0050BA6940E5}\,{D8E814A0-E0C5-11d4-8D29-0050BA6940E6}\,{D9E814A0-E0C5-11d4-8D29-0050BA6940E7}\,{D9E814A0-E0C5-11d4-8D29-0050BA6940E8}\",",")
  30. RegValue1=split("设置窗口透明,最小所有窗口,关闭所有窗口,隐藏所有窗口(Ctrl+Alt+Q 还原),关于IE窗口(效果演示)",",")
  31. RegValue2=split("242,246,240,249,239",",")
  32. RegValue3=split("242,246,240,249,269",",")
  33. RegValue4=split("设置窗口透明,最小所有窗口,关闭所有窗口,隐藏所有窗口,关于IE窗口",",")
  34. RegValue5=split("设置窗口透明(&T),最小所有窗口(&M),关闭所有窗口(&C),隐藏所有窗口(&H),关于IE窗口(&A)",",")
  35. RegValue6=split("T,M,C,H,A",",")
  36. RegForm1="REG_SZ"
  37. IF LCase(FileFullName) <> LCase(InsFullName) then
  38. intAnswer = MsgBox("【是】将“"+ InsAnswer +"”加入到IE工具栏,"&Chr(10)&Chr(10)&"【否】将“"+ InsAnswer +"”从IE工具栏删除。 ", vbQuestion + vbYesNoCancel, "安装 - "+ InsTitle +" - "+ Copyright)
  39.     If intAnswer = vbYes Then
  40. For i=0 To UBound(RegPath2)
  41. WshSHell.RegWrite RegPath1&RegPath2(i)&"ButtonText",RegValue1(i),RegForm1
  42. WshSHell.RegWrite RegPath1&RegPath2(i)&"HotIcon",InsPath&"\shell32.dll,"&RegValue2(i),RegForm1
  43. WshSHell.RegWrite RegPath1&RegPath2(i)&"Icon",InsPath&"\shell32.dll,"&RegValue3(i),RegForm1
  44. WshSHell.RegWrite RegPath1&RegPath2(i)&"MenuStatusBar",RegValue4(i),RegForm1
  45. WshSHell.RegWrite RegPath1&RegPath2(i)&"MenuText",RegValue5(i),RegForm1
  46. WshSHell.RegWrite RegPath1&RegPath2(i)&"Exec",chr(34) & InsPath &"\IEO"& RegValue6(i) &".vbs"& chr(34),RegForm1
  47. WshSHell.RegWrite RegPath1&RegPath2(i)&"CLSID","{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}",RegForm1
  48. WshSHell.RegWrite RegPath1&RegPath2(i)&"Default Visible","Yes",RegForm1
  49. Set otFile=FSO.OpenTextFile(InsPath &"\IEO"& RegValue6(i) &".vbs",2,True)
  50. otfile.WriteLine("WScript.CreateObject(""WScript.Shell"").Run(""wscript.exe "&InsFullName&chr(32)&RegValue6(i)&"""):WScript.Quit")
  51. otFile.Close
  52. Next
  53. Set otFile=FSO.OpenTextFile(InsPath &"\IEOS.vbs",2,True)
  54. otfile.WriteLine("WScript.CreateObject(""WScript.Shell"").Run(""wscript.exe "&InsFullName&chr(32)&"S"&"""):WScript.Quit")
  55. otFile.Close
  56. WshSHell.RegWrite "HKLM\SOFTWARE\LLKJ\SYSSoft\IE_Optimize\","IE工具栏增强","REG_SZ"
  57. WshSHell.RegWrite "HKLM\SOFTWARE\LLKJ\SYSSoft\IE_Optimize\TM","175","REG_SZ"
  58. FSO.GetFile(FileFullName).Copy(InsFullName)
  59. Call alltovbs
  60. If (FSO.FolderExists(FSO.BuildPath(LnkPathAll ,"\附件\" & MyShortcutFolder))) Then
  61. else
  62. FSO.CreateFolder(FSO.BuildPath(LnkPathAll ,"\附件\" & MyShortcutFolder))
  63. end if
  64. Set MyShortcut = WshShell.CreateShortcut(FSO.BuildPath(LnkPathAll ,"附件\" & MyShortcutFolder & "\" & MyShortcutName))
  65. MyShortcut.TargetPath = (InsPath &"\IEOS.vbs")
  66. MyShortcut.WorkingDirectory = (InsPath)
  67. MyShortcut.Windowstyle = 4
  68. MyShortcut.Description = "显示所有IE窗口"
  69. MyShortcut.Hotkey = MyShortcutHotKey
  70. MyShortcut.Save
  71. WshSHell.popup _
  72. "添加脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+ _
  73. "添加系统热键:" +chr(10)+chr(34) & MyShortcutHotKey +chr(34)+chr(10)+chr(10)+ _
  74. "添加执行文件:"+chr(10)+FSO.BuildPath(OtherFilePath,OtherFileName)+chr(10)+chr(10)+ _
  75. "添加注册表项:"+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10) & _
  76. chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _
  77. chr(10) & "Copyright(C)  " + Copyright +"   " & QQ &"   " + Email _
  78. , CloseTime, "安装成功 - "+ InsTitle +" - "+ Copyright, 0 + 64
  79. end if
  80.         If intAnswer = vbNo Then
  81. For i=0 To UBound(RegPath2)
  82. WshSHell.RegDelete RegPath1&RegPath2(i)
  83. WshSHell.RegDelete InsPath &"\IEO"& RegValue6(i) &".vbs"
  84. Next
  85. WshSHell.RegDelete InsPath &"\IEOS.vbs"
  86. WshSHell.RegDelete "HKLM\SOFTWARE\LLKJ\SYSSoft\IE_Optimize\"
  87. FSO.DeleteFile InsFullName
  88. FSO.DeleteFile FSO.BuildPath(LnkPathAll ,"附件\" & MyShortcutFolder & "\" & MyShortcutName)
  89. intAnswer = MsgBox("【是】将保留文件“"+ OtherFileName +"”为其他程序服务,"&Chr(10)&Chr(10)&"【否】将彻底删除“"+ OtherFileName +"”文件由系统目录。 ", vbQuestion + vbYesNo, "卸载 - "+ InsTitle +" - "+ Copyright)
  90.        If intAnswer = vbYes Then
  91. FSO.DeleteFile FSO.BuildPath(OtherFilePath,OtherFileName)
  92. WshSHell.popup _
  93. "删除脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+ _
  94. "删除系统热键:" +chr(10)+chr(34) & MyShortcutHotKey +chr(34)+chr(10)+chr(10)+ _
  95. "删除注册表项:"+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10) & _
  96. chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _
  97. chr(10) & "Copyright(C)  " + Copyright +"   " & QQ &"   " + Email _
  98. , CloseTime, "卸载成功 - "+ InsTitle +" - "+ Copyright, 0 + 64
  99. end if
  100.         If intAnswer = vbNo Then
  101. WshSHell.popup _
  102. "删除脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+ _
  103. "删除系统热键:" +chr(10)+chr(34) & MyShortcutHotKey +chr(34)+chr(10)+chr(10)+ _
  104. "删除执行文件:"+chr(10)+FSO.BuildPath(OtherFilePath,OtherFileName)+chr(10)+chr(10)+ _
  105. "删除注册表项:"+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10) & _
  106. chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _
  107. chr(10) & "Copyright(C)  " + Copyright +"   " & QQ &"   " + Email _
  108. , CloseTime, "卸载成功 - "+ InsTitle +" - "+ Copyright, 0 + 64
  109. end if
  110. end if
  111.         If intAnswer = vbCancel Then
  112. end if
  113. ELSE
  114. if Args(0)="T" then
  115. TM=Round(WshSHell.RegRead("HKLM\SOFTWARE\LLKJ\SYSSoft\IE_Optimize\TM"),0)
  116. WshSHell.Run("nircmd.exe win trans ititle ""internet explorer"" "&TM), vbHide
  117. TMS=Round(TM+20,0)
  118. if TMS > 255 then TMS=175
  119. WshSHell.RegWrite "HKLM\SOFTWARE\LLKJ\SYSSoft\IE_Optimize\TM",TMS,"REG_SZ"
  120. elseif Args(0)="M" then
  121. WshSHell.Run("nircmd.exe win min class ""IEFrame"""), vbHide
  122. elseif Args(0)="C" then
  123. WshSHell.Run("nircmd.exe win close class ""IEFrame"""), vbHide
  124. elseif Args(0)="H" then
  125. WshSHell.Run("nircmd.exe win hide class ""IEFrame"""), vbHide
  126. elseif Args(0)="S" then
  127. WshSHell.Run("nircmd.exe win show class ""IEFrame"""), vbHide
  128. elseif Args(0)="A" then
  129. WshSHell.popup vbcrlf&"工具栏增强工具 For Internet Explorer 版 By baomaboy"&vbcrlf&vbcrlf&vbcrlf&CloseTime & " 秒钟后本窗口将自动关闭!开始演示窗口透明及其他效果。" &vbcrlf&vbcrlf&"Copyright(C)  " & Copyright &"   " & QQ &"   " + Email, CloseTime, InsTitle +" - "+ Copyright, 0 + 64
  130. count=255
  131. WScript.Sleep 2000
  132. WshSHell.popup vbcrlf&"所有IE窗口透明渐变效果!(目前不要操作鼠标和键盘)"&vbcrlf&vbcrlf&vbcrlf&CloseTime & " 秒钟后本窗口将自动关闭!" &vbcrlf&vbcrlf&"Copyright(C)  " & Copyright &"   " & QQ &"   " + Email, CloseTime, InsTitle +" - "+ Copyright, 0 + 64
  133. WshSHell.Run("nircmd.exe win max class ""IEFrame"""), vbHide
  134. For i=1to 50
  135. count=count-5
  136. WScript.Sleep 90
  137. WshSHell.Run("nircmd.exe win trans ititle ""internet explorer"" "&count), vbHide
  138. next
  139. WScript.Sleep 500
  140. count=5
  141. For i=1to 50
  142. count=count+5
  143. WScript.Sleep 90
  144. WshSHell.Run("nircmd.exe win trans ititle ""internet explorer"" "&count), vbHide
  145. next
  146. WScript.Sleep 2000
  147. WshSHell.popup vbcrlf&"所有IE窗口最小/大化效果!(目前不要操作鼠标和键盘)"&vbcrlf&vbcrlf&vbcrlf&CloseTime & " 秒钟后本窗口将自动关闭!" &vbcrlf&vbcrlf&"Copyright(C)  " & Copyright &"   " & QQ &"   " + Email, CloseTime, InsTitle +" - "+ Copyright, 0 + 64
  148. For i=1to 3
  149. WScript.Sleep 1000
  150. WshSHell.Run("nircmd.exe win min class ""IEFrame"""), vbHide
  151. WScript.Sleep 1000
  152. WshSHell.Run("nircmd.exe win max class ""IEFrame"""), vbHide
  153. next
  154. WScript.Sleep 2000
  155. WshSHell.popup vbcrlf&"所有IE窗口隐藏/显示效果!(目前不要操作鼠标和键盘)"&vbcrlf&vbcrlf&vbcrlf&CloseTime & " 秒钟后本窗口将自动关闭!" &vbcrlf&vbcrlf&"Copyright(C)  " & Copyright &"   " & QQ &"   " + Email, CloseTime, InsTitle +" - "+ Copyright, 0 + 64
  156. For i=1to 3
  157. WScript.Sleep 1000
  158. WshSHell.Run("nircmd.exe win hide class ""IEFrame""")
  159. WScript.Sleep 1000
  160. WshSHell.Run("nircmd.exe win show class ""IEFrame""")
  161. next
  162. WScript.Sleep 2000
  163. WshSHell.Run("nircmd.exe win max class ""IEFrame""")
  164. WScript.Sleep 8000
  165. WshSHell.Run("nircmd.exe win close class ""IEFrame"""), vbHide
  166. end if
  167. else
  168. WScript.Quit(0)
  169. end if
  170. End IF
  171. Set WshSHell = Nothing
  172. Set FSO = Nothing
  173. Set Args = Nothing
  174. WScript.Quit(0)
  175. sub alltovbs()
  176. 'any2vbs→
  177. end sub
复制代码
VBS+nircmd for Internet Explorer

IE工具栏增强→VBS版

一、在IE工具栏添加图标:
①设置IE窗口透明(5级)。
②最小化所有IE窗口。
③关闭所有IE窗口。
④隐藏所有IE窗口。
⑤关于增强工具的效果演示。

二、添加快捷键:
“Ctrl + Alt + Q ”用于隐藏所有IE窗口后复原窗口。



安装完成后如IE工具栏没出现图标则需要在“自定义工具栏”中手动添加。
作者: zhangop9    时间: 2011-12-21 09:42

作者没写完!!!!
sub alltovbs()

'any2vbs→这中间没有东东!!

end sub




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2