faqts : Computers : Programming : Languages : Asp : ASP/VBScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

156 of 222 people (70%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

can i run .exe through asp script

Feb 19th, 2002 22:57
Jeff McDonald, Manjula S, ashutosh sharma,


How can you pass arguments to the executable?  Say I wanted to run 
something like:
p_r1.exe 1 "test"  ...
how are the args added?
VBScript to execute exe from asp:
<%
  Const ForReading = 1
  sDir = "c:\test\debug" 
  set oShell = Server.CreateObject("Shell.Application")
  set oFolder = oShell.NameSpace(sDir)  
  ' oFile is a FolderItem
  set oFile = oFolder.ParseName ("p_r1.exe")
  ' response.write "Testing" & "<BR>"
  ' response.write oFile.Name & "<BR>"
  ' response.write oFile.IsFileSystem & "<BR>"
  ' response.write oFile.ModifyDate & "<BR>"
  ' response.write oFile.Size & "<BR>"
  ' response.write oFile.Type & "<BR>"
  ' response.write oFile.Path & "<BR>"
  oFile.InvokeVerb
%>



© 1999-2004 Synop Pty Ltd