After much testing, I concluded that the program did not direct output to stdout on successful completion.
Maybe, to stdin/con, I couldn't find the answer.
However, the errors did go to stderr so I just focused on that.
Finally, using Brad Lanam's code, answering a question on Stackoverflow (
https://stackoverflow.com/questions/41705067/how-to-get-a-return-value-of-a-c-exe-file-in-tcl-windows), it looked like this :
# file is the parameter of batch
set returnvalue 1
try {
exec mandamail.bat $file 2> err_$file
set returnvalue 0
} trap {CHILDSTATUS} {resul retopts} {
lassign [dict get $retopts -errorcode] class pid retcode
set returnvalue $retcode
}
if {$returnvalue != 0} {
set filerr err_$file
set ferr [open $filerr r]
puts [read $ferr]
close $ferr
} else {
puts "Mail sent succefully !"
}
Saludos,
Alejandro
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)