Make an Internet Explorer toolbar button with VBScript

Source: Internet
Author: User
Tags define end key require
The various buttons on the IE toolbar of the vbscript| button are not a Microsoft patent, as normal users can customize it, add the buttons you want to set up, and the way you add it, many of the data are described. The specific implementation of the two kinds, one is the use of lengthy and complex VC or VB code program, this requirement for ordinary users is a bit too high, usually make people full head fog and not to achieve the goal; the other is to do it by hand, but this method is extremely unsafe because of the drastic modification of the system registry. Accidentally will be self-defeating, let you reinstall the system!
I'm here to introduce a compromise method that uses VBScript's Homemade IE toolbar button, which does not require lengthy and complex program code, and does not require tedious changes to the system registry, but it can also achieve the purpose of a homemade IE toolbar button.
Whether using VB or VC or manual method to add a button, in the final analysis is to modify the system registry. VBScript is no exception, but its code is easy to understand and safe to learn. Now that you want to change the registry, you need to know the path to the operating target in the registry. The path of IE's homemade toolbar button in the registry is:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\extensions]
Each primary key under the branch represents a homemade toolbar button. Such as:
{Cd67f990-d8e9-11d2-98fe-00c0f0318afe} says: RealPlayer
{57e91b47-f40a-11d1-b792-444553540000} says: Netants
In imitation of these primary keys, we can "make" a {00000000-0000-0000-0000-000000000001} (but note that this key value must be unique, it is not possible to break other toolbar buttons).
Under each of these primary keys, there are usually several key values (all of which are string):
ButtonText: The text displayed on the custom button.
Clsid:ie The class identification code for the toolbar, constant is "{1fba04ee-3024-11d2-8f1f-0000f87abd16}".
Default Visible: Controls whether the custom button is visible, generally "Yes".
Exec: The goal of custom button execution, which can be a link to an executable program or hypertext.
Hoticon: The icon that appears when you move the mouse over the button.
Icon: Icons that the button displays correctly.
MenuText: The menu item displayed in the IE's Tools menu.
Menustatusbar: The annotation text that appears on the status bar.
Knowing these prerequisites, and then using VBScript to make the IE toolbar button is not difficult, I will add the "My Computer" button as an example to illustrate the use of VBScript to implement the Internet IE toolbar button method.
Addbutton.vbs (Save the following code as a addbutton.vbs file)
Define an object to communicate with the operating system
Dim WshShell
Set wshshell=wscript.createobject ("Wscript.Shell")
Define the various parameters associated with a button
keyname_11= "ButtonText"
keydata_12=, "My Computer."
keyname_21= "CLSID"
Keydata_22= "{1fba04ee-3024-11d2-8f1f-0000f87abd16}"
keyname_31= "Default Visible"
Keydata_32= "Yes"
keyname_41= "Exec"
Keydata_42= "C:\Windows\Explorer.exe"
keyname_51= "Hoticon"
Borrow the RealPlayer icon
keydata_52= "C:\Program Files\real\realplayer\eb_act.ico"
keyname_61= "Icon"
Borrow the RealPlayer icon
keydata_62= "C:\Program Files\real\realplayer\eb_inact.ico"
keyname_71= "MenuText"
keydata_72=, "My Computer."
keyname_81= "Menustatusbar"
Keydata_82= "Turn on My Computer"
Defining parameters related to the operation of the registry
Regpath= "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet explorer\extensions\{ 00000000-0000-0000-0000-000000000001}\ "
Datatype= "REG_SZ"
Defines a functional function that adds parameters to the registry
Function Valueadd (Keyname,keydata)
WshShell.RegWrite Regpath&keyname,keydata,datatype
End Function
Call the Add () procedure, add parameters to the registry
Call Valueadd (Keyname_11,keydata_12)
Call Valueadd (keyname_21,keydata_22)
Call Valueadd (KEYNAME_31,KEYDATA_32)
Call Valueadd (keyname_41,keydata_42)
Call Valueadd (keyname_51,keydata_52)
Call Valueadd (keyname_61,keydata_62)
Call Valueadd (keyname_71,keydata_72)
Call Valueadd (keyname_81,keydata_82)
POPs up the confirmation information box and makes the appropriate processing
Dim Confirm
Confirm=msgbox ("Homemade button has been added successfully, need to reboot the system to take effect, do you want to reboot?", 4, "please Confirm!")
If confirm=6 Then
MsgBox ("The homemade button has been set successfully, please reboot the system!")
Else
Wscrip T.quit ()
End If

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.