Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Problem executing programs from ASP

Reply
Thread Tools

Problem executing programs from ASP

 
 
Morten Frederiksen
Guest
Posts: n/a
 
      08-18-2004
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


 
Reply With Quote
 
 
 
 
Jeff Cochran
Guest
Posts: n/a
 
      08-18-2004
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
>


 
Reply With Quote
 
 
 
 
Morten Frederiksen
Guest
Posts: n/a
 
      08-18-2004

"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


 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-18-2004
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.


 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      08-18-2004
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
 
Reply With Quote
 
Morten Frederiksen
Guest
Posts: n/a
 
      08-18-2004
"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


 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-18-2004
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing programs in "background" wstach@gmail.com ASP General 1 03-29-2008 09:23 AM
Executing and Monitoring External Programs mach7sonic@gmail.com C Programming 13 02-01-2008 03:38 PM
executing unix programs through java ruds Java 4 08-21-2006 06:28 AM
executing python programs as if they were on OS path (noob) Darren Dale Python 8 08-03-2004 09:46 PM
Executing Programs Using Javascript Rob V Javascript 5 09-18-2003 06:59 PM



Advertisments