0
votes

I have created a custom rightclick menu element in IE8 using the following registry info:

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\WebOn edit] @="c:\\webon_edit\\wo_edit.vbs"

The choice "WebOn edit" shows up in IE8's rightclick menu. Before upgrading to Windows 7, this worked fine: When I clicked the menu choice, the "wo_edit.vbs" file ran (using cscript) and did the stuff it was supposed to.

But now, nothing happens. It seems like cscript does not get invoked at all.

Is this due to some security restrictions about not using external vbscript from IE?

1
Have you checked your IE security settings? - Tester101
Yes, I even tried setting all zones to "Low", but still there is nothing happening, apart from a quick, almost undetectable flashing of the menu bar. - Knut Brobakken

1 Answers

0
votes

you cannot execute cscript directly from the context menu in IE8. The simplest option is to either wrap your VBScript inside an html file, or execute cscript from within an html file. Then simply call that html using the context menu.

To do this create a html file with your vbscript in it, or a call to cscript. Then set your registry string to use that file with @="file://C:\example.html".

Execute VB example:

<HTML>
  <HEAD>
    <SCRIPT LANGUAGE="VBScript">
      Sub ShowVBisWorking()
        MsgBox("I'm working")
      End Sub
    </SCRIPT>
  </HEAD>
  <BODY ONLOAD=ShowVBisWorking()>
  <BODY>
</HTML>

Execute cscript example:

<HTML>
  <HEAD>
    <SCRIPT LANGUAGE="VBScript">
      Sub LaunchProcess()
        Dim Shell
        Set Shell = CreateObject("Wscript.Shell")
        Shell.Run "cscript c:\test.vbs",1
        Set Shell = Nothing
      End Sub
    </SCRIPT>
  </HEAD>
  <BODY ONLOAD=LaunchProcess()>
  <BODY>
</HTML>