Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Forums > Tutorials

Vista Tutorial - How to Open Selected Registry Address from Internet Explorer into Regedit

Comment
 

How to Open Selected Registry Address from Internet Explorer into Regedit

Published by sidney1st
06-12-2008

How to Open Selected Registry Address from Internet Explorer into Regedit

Adding a function in the context menu is quite easy.

You noticed that many apps offer some context menu facilities, to do so they mainly use an activex/addon installed with their program.

An IE context menu item is usually linked to a htm/html file wich includes scripts, links to activex, etc... and use a personalized dll.

In fact we have to write a script, embed it or name it as a htm file and ask the registry to write an entry in the context menu which on click links to the htm file.

Due to UAC, the htm file will ask to open a VBS file which will do the job.
A prompt will ask you if you accept to run the script.
Personally i place the htm file in the common files folder where i created a folder named "Registry" just to remember it better, but it could be anywhere.
The VBS file should be in %windir% so that it can be called from anywhere.
Then, the last thing to do is to add the registry key which will modifiy the IE context menu.

The added context menu items are in:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\


OPTION ONE:
1/ We will start by the htm file:

We want to add in the context menu an item which when clicked opens Regedit at a selected Address.
So we have to make a script which copy the selected Address into the clipboard.


Code:
<SCRIPT>
var CheckForSelection = window.external.menuArguments.document.selection.createRange().text;
window.clipboardData.setData("Text",CheckForSelection);
</SCRIPT>
Well, now we have to run a vbs script which will do the rest of the job.
We will call this VBScript OpenReg, we will make it after this step.


Code:
<SCRIPT LANGUAGE="VBScript">
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "%windir%\OpenReg.vbs",1,False
Set WshShell = Nothing
</SCRIPT>
We just copy these 2 scripts above in notepad and save as OpenReg.htm in: C:\Program Files\Common Files\Registry


2/ It is time now to make the script which will open Regedit at the selected address.


Code:
Set oSh = CreateObject("WScript.Shell")
Set oHtml = CreateObject("htmlfile")
Set oClipBoard = oHtml.ParentWindow.ClipBoardData
Set Shell = WScript.CreateObject("WScript.Shell")
strText = oClipBoard.getData("Text")
Set WshShell = CreateObject("WScript.Shell")
Dim Cle
Cle = "Computer\" & strText
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Lastkey",Cle,"REG_SZ"
WshShell.Run "regedit", 1,True
Set WshShell = Nothing
We just copy these lines above in notepad and save as OpenReg.vbs in: C:\Windows


3/ To finish, we write the new key in the registry.

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\

Create a new key named: Open In Regedit and give as default value: File://C:\Program Files\Common Files\Registry\OpenReg.htm

Close Regedit, open IE and test. (select a registry address, right click and "Open in Regedit").


OPTION TWO:
If you are as lazy as i am, all files are in the attached zip file.


Openinreg.zip < Click To Download
  • Extract OpenReg.htm to C:\Program Files\Common Files\Registry
  • Extract OpenReg.vbs to C:\Windows
  • Run openinreg.reg to write the context menu key in the registry
Published by
sidney1st's Avatar
Member
Join Date: Apr 2008
Location: Paris
Posts: 971
Rep Power: 74
sidney1st has a reputation beyond reputesidney1st has a reputation beyond reputesidney1st has a reputation beyond reputesidney1st has a reputation beyond reputesidney1st has a reputation beyond reputesidney1st has a reputation beyond reputesidney1st has a reputation beyond reputesidney1st has a reputation beyond reputesidney1st has a reputation beyond reputesidney1st has a reputation beyond reputesidney1st has a reputation beyond repute

Tutorial Tools

Applies to
All Vista Versions
64 Bit & 32 Bit

Old 06-13-2008  
Respawns
Member


Join Date: May 2008
Vista Ultimate x64 SP1
 
 

Re: How to Open Selected Registry Address from Internet Explorer into Regedit

Nice tut thanks man

My System SpecsSystem Spec
Comment

Tutorial Tools


Similar Threads
Tutorial Category
Highlight selected folder/key in regedit Vista General
link Address address bar at top of Internet explorer 8 Vista General
It says my internet is connected but when I open Internet Explorer it doesn't work! Browsers & Mail
How to Open Selected Text from Internet Explorer into Notepad Tutorials
Access denied in registry with regedit Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
Tutorial powered by GARS 2.1.8m ©2005-2006

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46