How can i run a .bat file from ASP
How can i run a bat file using ASP.My .bat file will be calling an exe.
I tried many code like the ones below
=====================
dim server_shell,RetCode
Set server_shell = server.CreateObject("wscript.shell")
RetCode=server_shell.Run ("c:/Inetpub/wwwroot/og/bat/a.bat",8,false)
When i run this code i can see an error message in server .The applicatoin Failed to intialize properly(0xc0000142)
======================
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "cmd.exe"
Executor.Parameters = "/c c:\a.bat"
Executor.ShowWindow = True
Response.Write "Attempting to execute " & Executor.Application & "<br>"
strResult = Executor.ExecuteWinApp()
Response.Write "The result of this call was: " & strResult
=======================
pls give me a solution.
|