Problem executing programs from ASP

M

Morten Frederiksen

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
 
J

Jeff Cochran

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
 
M

Morten Frederiksen

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
 
J

Jeff Cochran

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.


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
 
M

Morten Frederiksen

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
 
B

Bob Barrows [MVP]

Morten said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top