title: How can i call VBscript from Javascript
body: <p>I have searched the threads here but could not find anything remotely related to what i am trying to do. Basically i want to call vbscript using javascript for the onClick.</p>
  
  <p>Is there a way to call aVBScript for the onClick event from a button that uses Javascript onmouseover and onmouseout events?</p>
  
  <p>I can't seem to get it to work and need help. Below is a snippet of my javascript code and also vb script i would like to call out to:</p>
  
  <p>Javascript code:</p>
  
  <pre><code>&lt;td align="center"&gt;
      &lt;input onMouseOver="window.status=me.value" onMouseOut="window.status=''" onMouseOver="window.status=me.value" onMouseOut="window.status=''" type="button" value="Impersonation" class="redBtn" onClick="openPopup('http://internal.mps.cardinal.net/cardcom/index.asp')" /&gt;
     &lt;/td&gt;
     &lt;td align="center"&gt;
      &lt;input onMouseOver="window.status=me.value" onMouseOut="window.status=''" onMouseOver="window.status=me.value" onMouseOut="window.status=''" type="button" value="ServiceNow" class="normalBtn" onClick="openPopup('https://cardinal.service-now.com/navpage.do')" /&gt;
     &lt;/td&gt;
  </code></pre>
  
  <p>What i would like to do is call out to the vbscript for the ServiceNow OnClick event. </p>
  
  <p>My VBscript:
      WScript.Quit Main</p>
  
  <pre><code>Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "https://cardinal.service-now.com/navpage.do"
  Wait IE
  
  With IE.Document
  On Error Resume Next
    .GetElementsByName("EnterpriseID")(0).value = "admin"
    .GetElementsByName("PASSWORD")(0).value = "admin"
  End With
  
  IE.Document.getElementByID("SignInBtn").Click
  
  End Function
  
  Sub Wait(IE)
  Do
  WScript.Sleep 500
  Loop While IE.ReadyState &lt; 4 And IE.Busy 
  Do
  WScript.Sleep 500
  Loop While IE.ReadyState &lt; 4 And IE.Busy 
  End Sub
  
  Sub IE_OnQuit
  </code></pre>
  
  <p>On Error Resume Next
  WScript.StdErr.WriteLine "IE closed before script finished."
  WScript.Quit
  End Sub</p>
  
  <p>Thank you for any help you can provide</p>