Results 1 to 3 of 3

Thread: Executing .bat file from ASP

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    3

    Unhappy Executing .bat file from ASP

    Hello

    I have been attempting to execute a .bat file from ASP using the following code:

    Code:
    Dim objShell, rCode
    Set objShell = Server.CreateObject("WScript.Shell")
    
    rCode = objShell.Run("d:\Lisa\ITG\test.bat", 1, True)
    Set objShell=nothing
    The batch file has a simple command line execution of an application in it, which works.

    Every website I have referred to has similar code to that above. However, when I run the code, (which occurs after filling in an online form and the data is captured), I get a "page cannot be displayed" error (without the code above, the resulting page appears fine).

    I have come to the conclusion that it must be something to do with my server settings. I am running IIS (Windows 2000). I have set the permissions to allow scripts and executables.

    Does anyone have any ideas on how I can get this working? Thanks.
    Last edited by goosel; Jul 17th, 2005 at 11:20 PM.

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    3

    Unhappy Re: Executing .bat file from ASP

    Can anyone at all help with this?

    If you do not know a solution, can someone confirm I have the correct script?

    Thanks and regards,
    -goosel

  3. #3
    Addicted Member
    Join Date
    Jun 2005
    Posts
    139

    Re: Executing .bat file from ASP

    The code is fine.

    Check the execute permission in the IIS Configuration of the web site. It will be in the "Home Directory" tab of the property page of the web site.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width