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.
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
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.