DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to run Batch file using ASP

Hybrid View

  1. #1
    Prasanna Devadas Guest

    How to run Batch file using ASP


    Hi,

    I want to run a .bat file, using ASP. How to run this ? Please help me
    with code.

    Thanks,
    d.prasanna

  2. #2
    Sidewinder Guest

    Re: How to run Batch file using ASP


    Hi Prasanna,

    If you have full control and access to the machine (i.e. you are not hosting
    the site on someone else's machine) you could write a very simple VB COM
    object that simply takes the inputs from the ASP page and then shells out
    to the .bat file. In ASP

    <% Set myObj = CreateObject("myco.myobj")
    myObj.CallBat(info)
    %>

    In the VB COM object:

    Public Sub CallBat(info as String)
    iHandle = Shell("c:\myfile.bat " & info)
    End Sub


    The .bat file will be executed on the server. The advantage of Shell is that
    it returns immediately so the ASP page does not hang waiting for the .bat
    to complete.

    I do not know if W2K ASP has an inbuilt Shell function, this code is for
    NT4.0

    "Prasanna Devadas" <prasanna@india.dharma.com> wrote:
    >
    >Hi,
    >
    > I want to run a .bat file, using ASP. How to run this ? Please help me
    >with code.
    >
    > Thanks,
    > d.prasanna



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center