> It would be great if /run could wait for a program to finish and then return the result (if any).

Here is a solution using COM that will work...

really only $myrun.a is needed, but be aware that halting script execution like this could be very bad in events (signal events are ok to use in)

alias myrun { .timerRun $+ $ctime 1 0 myrun.t $1- }
alias myrun.t { aecho Return: $myrun.a($1-) }
alias myrun.a {
var %Return | var %Com | set %Com %Member $+ $ticks
.comopen %Com WScript.Shell
if (!$comerr) {
set %Return $com(%Com,Run,3,bstr,$1,int,5,bool,1)
if (%Return == 0) { return $null }
set %Return $com(%Com).result
.comclose %Com
return %Return
}
return $null
}



NaquadaBomb
www.mirc-dll.com