Skip navigation

JSI Tip 0823. More on piping the entire contents of a batch file.

I first introduced the subject in tip 501.

Here are two twists on the technique.

1. Pipe a scheduled job:        AT hh:mm cmd /c batchfile.bat ^>c:\folder\batchlog.log 2^>^&1

2. Build a general purpose batch file pipe.bat which contains:

       @echo off
       @echo PIPE.BAT %1 %2 %3 %4 %5 %6 %7 %8 %9 > %1
       cmd /c %2 %3 %4 %5 %6 %7 %8 %9 >> %1 2>>&1

Example:

pipe d:\temp\batchfile.log batchfile.bat param1 param2 .. paramn

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish