Problem executing programs from ASP

Discussion in 'ASP General' started by Morten Frederiksen, Aug 18, 2004.

  1. Hi

    I am trying to execute a ping command from ASP, and I am really not getting
    anywhere. I wrote the following code based on what I found on the subject on
    the Internet:

    Dim sh, result
    Set sh = CreateObject("WScript.Shell")
    cmd = "ping 192.168.1.5 -n 1 -w 200"
    result = sh.Run(cmd, 1, true)
    Set sh = Nothing
    Set result = Nothing

    When I try loading the page containin this code, however, I get no response
    from the web-server. And occasionally I get an error message saying that the
    server could not handle the request due to too many users. Subsequent
    requests to the server, also on other files, seems to end up in the HTTP
    equivalent of a black hole, that is there is no response.

    I am running WinXP (which is incidentally up-to-date with regard to Windows
    Update) and IIS 5.1.

    I hope someone can help me with this problem.

    Regards
    Morten Frederiksen
    Morten Frederiksen, Aug 18, 2004
    #1
    1. Advertising

  2. Morten Frederiksen

    Jeff Cochran Guest

    On Wed, 18 Aug 2004 10:25:56 +0200, "Morten Frederiksen"
    <> wrote:

    >Hi
    >
    >I am trying to execute a ping command from ASP, and I am really not getting
    >anywhere. I wrote the following code based on what I found on the subject on
    >the Internet:
    >
    > Dim sh, result
    > Set sh = CreateObject("WScript.Shell")
    > cmd = "ping 192.168.1.5 -n 1 -w 200"
    > result = sh.Run(cmd, 1, true)
    > Set sh = Nothing
    > Set result = Nothing
    >
    >When I try loading the page containin this code, however, I get no response
    >from the web-server. And occasionally I get an error message saying that the
    >server could not handle the request due to too many users. Subsequent
    >requests to the server, also on other files, seems to end up in the HTTP
    >equivalent of a black hole, that is there is no response.


    What response are you loooking for and how do you know it isn't
    working? Might want to try one of the Ping components already
    available, such as:

    http://www.15seconds.com/component/pg000229.htm

    Jeff

    >
    >I am running WinXP (which is incidentally up-to-date with regard to Windows
    >Update) and IIS 5.1.
    >
    >I hope someone can help me with this problem.
    >
    >Regards
    >Morten Frederiksen
    >
    Jeff Cochran, Aug 18, 2004
    #2
    1. Advertising

  3. "Jeff Cochran" <> skrev i en meddelelse
    news:...
    > On Wed, 18 Aug 2004 10:25:56 +0200, "Morten Frederiksen"
    > <> wrote:


    > What response are you loooking for and how do you know it isn't
    > working?


    Just about any response would do! It seems that IIS hangs and there is no
    response at all. The ASP code I posted is of course only the offending code;
    the document contains more code and HTML, but none of it is displayed in the
    browser. I just get a blank window or the "too many users" error message.

    > Might want to try one of the Ping components already
    > available, such as:
    >
    > http://www.15seconds.com/component/pg000229.htm


    I am familiar with that one, but still the problem puzzles me.

    Regards
    Morten Frederiksen
    Morten Frederiksen, Aug 18, 2004
    #3
  4. That script opens a console window, which is not allowed in ASP.

    Morten Frederiksen wrote:
    > Hi
    >
    > I am trying to execute a ping command from ASP, and I am really not
    > getting anywhere. I wrote the following code based on what I found on
    > the subject on the Internet:
    >
    > Dim sh, result
    > Set sh = CreateObject("WScript.Shell")
    > cmd = "ping 192.168.1.5 -n 1 -w 200"
    > result = sh.Run(cmd, 1, true)
    > Set sh = Nothing
    > Set result = Nothing
    >
    > When I try loading the page containin this code, however, I get no
    > response from the web-server. And occasionally I get an error message
    > saying that the server could not handle the request due to too many
    > users. Subsequent requests to the server, also on other files, seems
    > to end up in the HTTP equivalent of a black hole, that is there is no
    > response.
    >
    > I am running WinXP (which is incidentally up-to-date with regard to
    > Windows Update) and IIS 5.1.
    >
    > I hope someone can help me with this problem.
    >
    > Regards
    > Morten Frederiksen


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Aug 18, 2004
    #4
  5. Morten Frederiksen

    Jeff Cochran Guest

    On Wed, 18 Aug 2004 14:52:16 +0200, "Morten Frederiksen"
    <> wrote:

    >
    >"Jeff Cochran" <> skrev i en meddelelse
    >news:...
    >> On Wed, 18 Aug 2004 10:25:56 +0200, "Morten Frederiksen"
    >> <> wrote:

    >
    >> What response are you loooking for and how do you know it isn't
    >> working?

    >
    >Just about any response would do! It seems that IIS hangs and there is no
    >response at all. The ASP code I posted is of course only the offending code;
    >the document contains more code and HTML, but none of it is displayed in the
    >browser. I just get a blank window or the "too many users" error message.
    >
    >> Might want to try one of the Ping components already
    >> available, such as:
    >>
    >> http://www.15seconds.com/component/pg000229.htm

    >
    >I am familiar with that one, but still the problem puzzles me.


    If you sat at the server you'd understand. The script, as written,
    can't retrun anything to a browser. It opens a DOS console on the
    server, which doesn't work, and everything is performed on the server.
    No response will go back to the client.

    That's why the component exists... :)

    Jeff
    Jeff Cochran, Aug 18, 2004
    #5
  6. "Bob Barrows [MVP]" <> skrev i en meddelelse
    news:...

    > That script opens a console window, which is not allowed in ASP.


    OK. I have tried using the Exec method instead, but that results in the same
    problem. Does the Exec method also open a window?

    But should this error really make the server hang?

    Regard
    Morten Frederiksen
    Morten Frederiksen, Aug 18, 2004
    #6
  7. Morten Frederiksen wrote:
    > "Bob Barrows [MVP]" <> skrev i en meddelelse
    > news:...
    >
    >> That script opens a console window, which is not allowed in ASP.

    >
    > OK. I have tried using the Exec method instead, but that results in
    > the same problem. Does the Exec method also open a window?
    >

    Try it in a vbs file and see.

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Aug 18, 2004
    #7
    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. Replies:
    12
    Views:
    1,613
    Dave Thompson
    Jan 10, 2005
  2. Coca
    Replies:
    7
    Views:
    722
    Aidan Grey
    Aug 24, 2004
  3. Replies:
    18
    Views:
    607
    Dave Thompson
    Jan 10, 2005
  4. lone_eagle
    Replies:
    3
    Views:
    622
    psykeedelik
    May 26, 2009
  5. Casey Hawthorne
    Replies:
    14
    Views:
    432
Loading...

Share This Page