PDA

Click to See Complete Forum and Search --> : How do I run (shell) an executable from VB Script?


Jamie_Dowd
Jul 14th, 2000, 10:58 AM
How do I run (shell) an executable from VB Script? Source appreciated.

dvst8
Jul 14th, 2000, 11:02 AM
this is mark's code:


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



compile this as a dll, register is, and then call it with the file you want to run from asp.

dvst8
all kudos to mark

Learning
Jul 14th, 2000, 03:59 PM
I have launched one .exe from ASP using VBSCript. My .exe is an ActiveX exe, suppose the Name is AAA.exe. Here is the code sample:


<%
response.redirect("http://YourIP/aaa.exe")
%>

<object height="0%" width="0%" ID="AAA" CLASSID="clsid:ClassIDForAAA" codebase="<%="YourIPWhereAAACAB is saved" & AAA.CAB#version=2,0,0,0%>">
<PARAM NAME="Enabled" VALUE=1>
</object>


----------------------------
the reason to put <object> here is the AAA.exe I created needs some dependency dlls which may not exists in the client computer. by putting an CAB there it will automatically download the cab and register those dependancies in the client computer so that my .exe can run smoothly.