home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,097 of 42,547   
   robtclilly@gmail.com to All   
   Re: Batch Files - show output on screen    
   30 Mar 15 09:27:05   
   
   d8f6819d   
   On Saturday, December 4, 2010 at 4:25:41 AM UTC-5, techman41973 wrote:   
   > I know you can pipe the output of a batch file to a text file   
   >  such as    launch.bag > log_file.txt   
   > but this turns off the output on the screen.   
   > Is there a way to keep the output on the screen AND write the output   
   > to a text file?   
   > I searched the archive of this newsgroup and did a google web search   
   > and can't find a conclusive answer to this question.   
      
   I know this is a very old post but, having just wrestled with this myself I   
   thought I'd add a little something - a variation of Tim Meddick's 2/19/14 post:   
      
   echo I want to see this on-screen and logged > TempLog.txt &type TempLog.txt   
   &type TempLog.txt >> RealLog.txt   
      
   The issue with the original was that it stomped  log_file.txt  on every write.   
   If the batch file has multiple logging points, you'll want to avoid that. The   
   line above does this by putting the contents of the temp log file on the   
   screen and then    
   appending it to the 'real' log file. On the next pass, the temp file is   
   overwritten (so you only see the current message) and is added to the master   
   log so you have historical info.    
      
   FWIW   
      
   Robert   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca