Passing parameters to executable

Results 1 to 2 of 2

Thread: Passing parameters to executable

  1. #1
    Join Date
    Dec 1969

    Default Passing parameters to executable

    I&#039;m trying to pass two parameters to an executable but it doesn&#039;t work. However, if I write : C:TMPac_inter.exe nuno 3456<BR>in the command line of Windows, it works correctly...<BR><BR>The code I&#039;m using is:<BR><BR> Set Executor = Server.CreateObject("ASPExec.Execute")<BR> Executor.Application = "C:TMPac_inter.exe nuno 3456"<BR> Executor.Parameters = ""<BR> Executor.ShowWindow = True<BR> Response.Write "Attempting to execute " & Executor.Application & "<BR>"<BR> strResult = Executor.ExecuteWinApp<BR> Response.Write "The result of this call was: " & strResult<BR>%&#062;<BR><BR>I also tried to write Executor.Parameters = "nuno 3265" but it also failed... <BR><BR>Can you help me?

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing parameters to executable

    I don&#039;that component installed on my System, but I looked at the syntax for say "tracing the route" command from DOS... and they have it like this (from:<BR><BR>Set Executor = Server.CreateObject("ASPExec.Execute")<BR>Executor .Application = "tracert"<BR>Executor.Parameters = Request.QueryString("host")<BR>strResult = Executor.ExecuteDosApp<BR>Response.Write "&#060;pre&#062;" & strResult & "&#060;/pre&#062;"<BR>set executor=nothing<BR><BR>Where tracert is the DOS command, and you only give the program name... (or a path to the exe program... such as c:windows racert .... notice no .exe ending?) <BR><BR>As well, all command line parameters are passed via the Parameter method.<BR><BR>I am going to install this COM object now... going to test it out, seems really interesting. <BR><BR>One more thing, you don&#039;t have to add the & "" here:<BR>Response.Write "Attempting to execute " & Executor.Application & "<BR>"<BR><BR>Hope this could have helped you. <BR><BR>Vadim C.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts