value from commanline-tool

C

curtis m. west

hello NG

i have a little commandlinetool, that returns a value (number) via stdio -
how can i display this value on an asp-page?

currently i use this "workaround": run the tool every 5mins (using the
scheduler) and redirecting the output to a txt-file (tool.exe > temp.txt)
and then i use the filesystem-object to read the value and display it on the
webpage...
....but this is:
a) not realtime
b) certainly not the best solution ;-)

so what's the propper way to do that?

tnx for a short feedback!
greetz, curtis
 
R

Ray at

You can try:


<%
Dim oShell, oExec, sCommand, sOutput
sCommand = "%comspec% /c tool.exe"
Set oShell = Server.CreateObject("WScript.Shell")
Set oExec = oShell.Exec(sCommand)
sOutput = sOutput & oExec.StdOut.ReadAll
Set oExec = Nothing
Set oShell = NOthing
Response.WRite sOutput
%>

Ray at work
 

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
474,146
Messages
2,570,832
Members
47,374
Latest member
anuragag27

Latest Threads

Top