Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 67,251 of 68,980    |
|    John Gray to All    |
|    Re: concatenate    |
|    26 Jun 18 06:15:13    |
      From: jgqued@gmail.com              On Monday, 25 June 2018 17:51:38 UTC+1, Zaidy036 wrote:       > On 6/25/2018 11:57 AM, Tom Del Rosso wrote:       > > I've done this since DOS 3.0 and always had trouble remembering the       > > syntax. Now the syntax is different of course.       > >       > > None of the syntaxes google finds actually work.       > >       > > I want to add a text file to the end of a log file. And it has to work       > > if the log file doesn't exist yet.       > >       > > Thank you.       > >       > >       > SET "_RPT=F:\Overnight.log"       > ECHO something > %_RPT% start a new _RPT       > ECHO something >> %_RPT% add to existing _RPT or start a new one if       > not exst       >       > --       > Zaidy036              For actual files, one way which works...              if exist logfile.txt (        copy logfile.txt+addedtext.txt logfile.txt        ) else (        rename addedtext.txt logfile.txt        rem or use copy instead of rename       )              Worth 'checking out' all the switches in COPY, in case any are of interest.              --- 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