How to run VBScript from javascript popup menu - TechRepublic
Question
August 29, 2008 at 11:58 AM
marvins611

How to run VBScript from javascript popup menu

by marvins611 . Updated 17 years, 10 months ago

For my html-php-mysql web page, I created a popup menu using UltraMenu. I want to launch VBScript from a menu item. The menu is written in javascript.

How do I execute a vbscript from a javascript menu? VBS is in the section of web page.

Triggering the VBScript (vbs) subroutines from html form elements, such as a button works perfect with events like onClick and onKeyDown.

This does not worked:

http://localhost/resume3/vchrAdd.php?id=8. The “8” is an action flag to execute a vbs script.

In php:

if ($action==8) {
$scripter = new COM(“MSScriptControl.ScriptControl”);
$scripter->Language = “vbscript”;
$k = $scripter->eval(“UnBusyInvoice()”); <<-- both double and single quotes fail. print "Result: $k\n"; $scripter = null; } It throws this error: Fatal error: Uncaught exception 'com_exception' with message Source: Microsoft VBScript runtime error Description:Type mismatch: 'UnBusyInvoice'' in C:\wamp\www\resume3\vchrAdd.php:207 Stack trace: #0 C:\wamp\www\resume3\vchrAdd.php(207): com->eval(‘UnBusyInvoice()’) #1 {main} thrown in
C:\wamp\www\resume3\vchrAdd.php on line 207

Thanks much.

This discussion is locked

All Comments