Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2004, 08:34 AM
Authorized User
 
Join Date: Sep 2003
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to flyin
Default 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






Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I attach a file to an email in my .vbs file savoym VBScript 3 July 2nd, 2011 08:02 AM
Question on .vbs file savoym VBScript 2 February 24th, 2005 12:12 PM
Scheduling VBS file madhukp VBScript 1 September 22nd, 2004 07:14 AM
urgent call exe with parameter from webform jainsaurabh78 Classic ASP Components 0 August 18th, 2004 02:00 AM
HELP with .VBS file savoym VBScript 1 July 31st, 2003 08:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.