Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to trigger a .vbs file on server side from clicking a weblink

Status
Not open for further replies.

Mingas

Programmer
Jul 10, 2013
15
ZA
Guys please assist: I have a series of scripts I’ve written in vbs. These serve to compile some report we require at random intervals. These scripts run on a standalone PC located across the room. Currently when we need the report, we have to walk over and double click the first .vbs script that calls the next and so forth when complete.

Now what I’ve done, is install Apache on this standalone PC to make it a “web server”. Created a landing page with a web link to it. The idea is to have people access the page from any PC, click on the link which will kick of the .vbs file in question….without us having to walk all the way across the room to accomplish that.

Is this even possible on server side?
 
I believe it is, although, you'll be restricted to using Internet Explorer and it is the only browser that has support for VBS "over the web". I would consider moving the .vbs files to a server and just access them from there (e.g. \\server\folder\report.vbs) or from the pc across the room (\\computername\driveletter$\folder\report.vbs)

However, if you are confident that IE will be explicitly used...

Code:
<html>
   <head>
      <title>Report Landing Page</title>

      <!-- Method 1: Include a vbs file (I prefer this method)-->
      <script language="vbscript" src="folder\report.vbs" \>

      <!-- Method 2: "Inline" vbs -->
      <script language="vbscript">
         sub doReport
            msgbox "the report is being run..."
         end sub
      </script>
   </head>
   <body>
      <a href="#" onClick="doReport">Click here to run report</a>
   </body>
</html>

-Geates

NOTE: IE does NOT support the WScript library so you'll have to modify your script according.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top