How do i call a .vbs file from within a webform?
Hello all,
I'm back with another question!
Scenario:
I have a vbscript file that does some wscript.shell calls to login to a series of sites and do some minor data mining. Well, this is all dandy, but how do i, within a click event of a button control or linkbutton control, fire off this .vbs file named GetFiles.vbs?
I know there is a solution client side via the following example, but
when i try to make this server side by putting the vbscript code within the <% ... %> or <script language=vbscript runat=server> ... </script> blocks, it just gives me the windows error beep noise, but no prompt as to what is the problem!!
here is the client side example that requires users to enable activeX Scripts that may not be safe, and also i think the files will download to their local machine, not to my server which is a big no no! well here goes anyways
<script language=vbscript>
Function PopExe
Dim oWSH
Set oWSH= CreateObject("WScript.Shell")
oWSH.Run "C:\....\ScriptFiles\GetWCFiles.vbs", 1, True
set oWSH = nothing
End Function
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Pop Exe </TITLE>
</HEAD>
<BODY>
<form ID="Form1">
<input type="button" name="btnLaunch" onClick="PopExe" value="Launch Exe" ID="Button1">
</form>
<a href="#" onClick="PopExe">Launch Exe</a>
</BODY>
</HTML>
as you can see this uses shell scripting to call the vbs file, is there a more simple way? i've tried putting the code in an asp page within <% ... %> but no go! thanks for you help in advance
flyin
|