Question : Windows Batch File STDOUT to console and file

I am writing a rather lengthy and complicated batch file, and I need to write the same windows STDOUT stream to both the console and to a file so the user can see the output in real time (to determine whether to proceed after each step), and archive it for review.

The most intuitive way seemed to be a pipe:

1:
echo hello world > my.log | >CON


But apparently echoing a stream to a file does not produce any further output.  I could also write all static text twice:

1:
2:
echo hello world > my.log
echo hello world


But I can't call commands like msiexec, copy, etc. twice just for logging purposes.

Please help.  Thanks in advance.

Answer : Windows Batch File STDOUT to console and file

ah, probably because the last fetch array gives False.   If I understand this right, you want it to print "good" if there is any row for this username,  and no good only if there is no row.

If that is correct, then try this:

///////  Mechanism to determine if the user has and data saved to this table  //////////////////////////  
include_once "connect_to_mysql.php";  
 
$sql = mysql_query("SELECT * FROM portfolio WHERE username='$username'");  
if ( mysql_num_rows($sql) == 0)
  print "return_msg=no_good";    
else
  print "return_msg=all_good";


Random Solutions  
 
programming4us programming4us