Advertisement

11.17.2004 at 08:59AM PST, ID: 21210300
[x]
Attachment Details

Executing through ASP

Asked by jorvidu in Miscellaneous Web Development

Tags:

I need to execute a file on my server. I've tried to use this code:

  <%
   set wshell = server.createobject("wscript.shell")
   set proc=wshell.Exec("program.exe")
   'let the action finish before attempting to do anything with it
   do while proc.status = 0
      wscript.sleep 100 'or 250, 500, try several values
   loop
   dim s : s = ""
   s = s & "<BR>a=" & proc.StdOut.ReadAll()
   s = s & "<BR>b=" & proc.StdErr.ReadAll()
   response.write(s)
   set wshell = nothing
   %>

But tells me somethjing like this:
Property "Exec" not accepted.

Then I tried this one:

    '    Dim wshell, intReturn, Cadena
        set wshell = server.createobject("wscript.shell")
      Cadena= "Date"
        '  wshell.run (Cadena)
        '  Response.Write( intReturn )
        '  set wshell = nothing

But gives me an error in the line of the run.
User IUSR_Machine has permissions from IIS...What the hell am I donig wrong!!...HELP!!!.
Good reward is waiting and glad to give it!.Start Free Trial
[+][-]11.17.2004 at 10:01AM PST, ID: 12606643

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Miscellaneous Web Development
Tags: waiting
Sign Up Now!
Solution Provided By: Razix
Participating Experts: 1
Solution Grade: C
 
 
[+][-]12.17.2004 at 09:33PM PST, ID: 12856058

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]12.18.2004 at 04:39AM PST, ID: 12856932

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32