asp running program with wscript.shell

Discussion in 'ASP General' started by bbxrider, Jun 4, 2005.

  1. bbxrider

    bbxrider Guest

    for win2k adv server/iis5.0
    trying to run an external program from my asp routine that has multiple
    parameters, see following

    set shell = server.createobject("wscript.shell")
    shell.Run """f:\phsData\htmldoc\htmldoc.exe"" --webpage -f phsnew.pdf
    phsnew.htm"

    program either doesn't get invoked, or has an error, but since it has no
    error log i can't check that,
    so not sure why not getting a result
    i have run the program successfully from the command line in that directory,
    so know it can be run in
    the first place and the asp program creates and writes files in the same
    directory so i don't think its a
    permission problem. asp doesn't complain with any errors

    so i'm stumped here and was hoping somebody can give an idea to check or
    something
     
    bbxrider, Jun 4, 2005
    #1
    1. Advertising

  2. First, I would be very suspicious of the use of « F:\ » if it is a mapped
    drive. Mapped drives are associated with a logon and will not be visible
    from inside the ASP process and should be replaced with an UNC name.

    Second, here a sample of the code that I'm using myself for running a
    program with multiple parameters:

    on error resume next
    Application.Lock

    CodeExit = wshShell.run ("""C:\Eval\EvEngine\RCTEvalTest.exe""
    C:\EVAL\EvEngine assumption " & NomFichier & " " & NomFichierA, 0, true)

    Application.UnLock
    on error goto 0

    If (CodeExit <> 0) Then
    Response.Write "A nice error message goes here --"
    end if

    I don't remember the signification of the two parameters 0 and True that I
    have put at the end of the call to Run() but maybe they are related to your
    problem.

    Another possibility would be to try running a .BAT file instead.

    --
    Sylvain Lafontaine, ing.
    MVP - Technologies Virtual-PC
    E-mail: http://cerbermail.com/?QugbLEWINF


    "bbxrider" <> wrote in message
    news:...
    > for win2k adv server/iis5.0
    > trying to run an external program from my asp routine that has multiple
    > parameters, see following
    >
    > set shell = server.createobject("wscript.shell")
    > shell.Run """f:\phsData\htmldoc\htmldoc.exe"" --webpage -f phsnew.pdf
    > phsnew.htm"
    >
    > program either doesn't get invoked, or has an error, but since it has no
    > error log i can't check that,
    > so not sure why not getting a result
    > i have run the program successfully from the command line in that
    > directory,
    > so know it can be run in
    > the first place and the asp program creates and writes files in the same
    > directory so i don't think its a
    > permission problem. asp doesn't complain with any errors
    >
    > so i'm stumped here and was hoping somebody can give an idea to check or
    > something
    >
    >
     
    Sylvain Lafontaine, Jun 5, 2005
    #2
    1. Advertising

  3. bbxrider

    bbxrider Guest

    thanks for reply
    still not working, 'f' is not mapped, its logical, and i created a virtual
    directory under iis, for the program directory, with exec privileges, so it
    should have the necessary run permissionss.
    i'm getting an error return code of 1 but not sure its telling anything
    other than did not run
    at this point i'm guessing its a command window problem, where its trying to
    open a command line window but its not allowed when running asp files under
    iis5.0 the '0' at end of parms is supposed to 'hide the window and activate
    another window', i think its the 'another window' maybe the problem,
    unfortunately all the other 'window style parameters' also try to do
    something with a window, so starting to look like a dead end

    "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
    wrote in message news:...
    > First, I would be very suspicious of the use of « F:\ » if it is a mapped
    > drive. Mapped drives are associated with a logon and will not be visible
    > from inside the ASP process and should be replaced with an UNC name.
    >
    > Second, here a sample of the code that I'm using myself for running a
    > program with multiple parameters:
    >
    > on error resume next
    > Application.Lock
    >
    > CodeExit = wshShell.run ("""C:\Eval\EvEngine\RCTEvalTest.exe""
    > C:\EVAL\EvEngine assumption " & NomFichier & " " & NomFichierA, 0, true)
    >
    > Application.UnLock
    > on error goto 0
    >
    > If (CodeExit <> 0) Then
    > Response.Write "A nice error message goes here --"
    > end if
    >
    > I don't remember the signification of the two parameters 0 and True that I
    > have put at the end of the call to Run() but maybe they are related to

    your
    > problem.
    >
    > Another possibility would be to try running a .BAT file instead.
    >
    > --
    > Sylvain Lafontaine, ing.
    > MVP - Technologies Virtual-PC
    > E-mail: http://cerbermail.com/?QugbLEWINF
    >
    >
    > "bbxrider" <> wrote in message
    > news:...
    > > for win2k adv server/iis5.0
    > > trying to run an external program from my asp routine that has multiple
    > > parameters, see following
    > >
    > > set shell = server.createobject("wscript.shell")
    > > shell.Run """f:\phsData\htmldoc\htmldoc.exe"" --webpage -f phsnew.pdf
    > > phsnew.htm"
    > >
    > > program either doesn't get invoked, or has an error, but since it has no
    > > error log i can't check that,
    > > so not sure why not getting a result
    > > i have run the program successfully from the command line in that
    > > directory,
    > > so know it can be run in
    > > the first place and the asp program creates and writes files in the same
    > > directory so i don't think its a
    > > permission problem. asp doesn't complain with any errors
    > >
    > > so i'm stumped here and was hoping somebody can give an idea to check or
    > > something
    > >
    > >

    >
    >
     
    bbxrider, Jun 5, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike John
    Replies:
    2
    Views:
    6,531
  2. Jesper Stocholm

    WScript.Shell and socket connection

    Jesper Stocholm, Aug 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    583
    Jesper Stocholm
    Aug 23, 2004
  3. Guoqi Zheng
    Replies:
    0
    Views:
    379
    Guoqi Zheng
    Jan 25, 2004
  4. Aayush Dubey
    Replies:
    0
    Views:
    518
    Aayush Dubey
    Aug 13, 2004
  5. LamSoft
    Replies:
    2
    Views:
    177
    LamSoft
    Aug 4, 2006
Loading...

Share This Page