WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Launch WinBatch from Internet Explorer Context Menu

 Keywords: Internet Explorer IE Context Right Click Menu Selected Text WinBatch Script IE 7 8 9 10 Windows 7 Win7 

Question:

I would like to launch a WinBatch script from IE right click context menu. Specifically I would like to send the selected text in IE to my Winbatch script. Can this be done?

Answer:

Yes. However it does require you to modify IE default security settings, which can potentially make your system vulnerable. So use at your own risk.

Its going to require the following steps

Create HTML

Create HTML file that contains javascript that launches WinBatch. Create an html file called C:\Program Files (x86)\WinBatch\Addons\ExtendIE\\WB_GetSelection.html
<SCRIPT LANGUAGE="JavaScript">
var parentwin = external.menuArguments; var doc = parentwin.document;
var sel = doc.selection; var rng = sel.createRange(); var str = new String(rng.text);
var oShell = new ActiveXObject("Shell.Application");
// Replace with your executable name
oShell.ShellExecute('c:\\Program Files\\WinBatch\\System\\WinBatch.exe', '"C:\\Program Files (x86)\\WinBatch\\Addons\\ExtendIE\\WB_GetSelection.wbt" "' + str + '"');
oShell = null;
</SCRIPT>

Create WBT

Create WBT file that accepts command line parameters from the javascript. Create a WBT file called C:\Program Files (x86)\WinBatch\Addons\ExtendIE\\WB_GetSelection.wbt
Pause('Highlighted Webpage Text',Param1)

Modify the registry.

Modify IE security

Reference: http://stackoverflow.com/questions/8834010/how-can-i-create-an-internet-explorer-addon


Article ID:   W17939
Filename:   Launch WinBatch from Internet Explorer Context Menu .txt
File Created: 2013:10:01:08:11:36
Last Updated: 2013:10:01:08:11:36