Does anyone know how I could launch a server side application in ASP (VBScript) ??
This is essential to some image processing (thumbnails) that I am doing.. see my Thumbnail thread for more info.
Thanks much!
Printable View
Does anyone know how I could launch a server side application in ASP (VBScript) ??
This is essential to some image processing (thumbnails) that I am doing.. see my Thumbnail thread for more info.
Thanks much!
This works if the exe displays no output I tried it with notepad and then with a batch file but it didn't work - no error though either ! :confused:
start a new ActiveX dll add the code below and compile it so the DLL is in your system dir (I'm not sure whether the location matters or not but for the time being it's best to narrow the odds of it working!)
Project1.Class1:
your Active server page can then call the DLL like thisCode:Option Explicit
Public Function RunExe(ByVal Filename As String) As Long
On Error Resume Next
Shell Filename
'return the error if any
RunExe = Err.Number
End Function
runexe.asp:
Code:<%@ Language=VBScript %>
<html>
<%
dim obj
set obj = server.CreateObject("Project1.Class1")
Response.Write("Error Code: " & obj.runexe("c:\mbs.exe"))
%>
</HTML>
Here's the trivial app to test it.
Just a module no forms.
mbs.exe:
Code:Option Explicit
Sub Main()
Dim fnum As Byte
fnum = FreeFile
Open "C:\mbs.mbs" For Output As fnum
Print #fnum, Now()
Close fnum
End Sub
wow...thanks mark.
i had never actually compiled my own dll before...
but the code you provided worked great!
thanks a bunch.
you wouldn't happen to know how to kill the app after i have finished with it would you?
merci!
Hey I'm pretty impressed as well because I made tht up my self and it's remarkably simular to this which I just found!
http://www.4guysfromrolla.com/webtech/072199-2.shtml
cool thanx