DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Passing text to batch file.  (Read 12,655 times)

brimstone

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 7
Passing text to batch file.
« on: April 04, 2008, 01:58 AM »
While I like the addnote and viewnote features of FARR2, I prefer more condensed information in my log files. I'm sure this is easy to do, but I can't seem to find out how to do it.

I've got a batch file in a directory that does exactly like addnote. I want to be able to run it and pass text to it from FARR.

echo %DATE% %TIME% Hello There!>>logfile.txt

How would I set it up in FARR to pass the text between %TIME% and >> ("Hello There!" in this case) to a batch file?

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
Re: Passing text to batch file.
« Reply #1 on: April 04, 2008, 04:25 AM »
I am curious to know the answer to your question as well :) sorry no help here

brimstone

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 7
Re: Passing text to batch file.
« Reply #2 on: April 04, 2008, 04:56 AM »
Actually, I figured out a solution without having a separate batch file.

znote1 $$1 | D:\Logfile\LOGECHO.COM $W $M/$D/$Y $h:$m - $$1>>logfile.txt

LOGECHO is a simple DOS program that lets me have more control over the date and time outputs.

So typing "znote1 Hello World!" into FARR results in:

Thu 04/03/08 23:52 - Hello World!

being added to logfile.txt in the same directory as LOGECHO.

You could also do the same using the parameters from my original post, except use cmd.exe instead of LOGECHO.

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
Re: Passing text to batch file.
« Reply #3 on: April 04, 2008, 05:01 AM »
Is this adding to the end or beginning?

brimstone

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 7
Re: Passing text to batch file.
« Reply #4 on: April 04, 2008, 05:05 AM »
Not sure what you mean, but I've attached a screenshot of my custom alias.

[attach]

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
Re: Passing text to batch file.
« Reply #5 on: April 04, 2008, 05:17 AM »
Sorry, I was asking if your arguments were writing to the end of the text file or beginning of the text file.

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,217
Re: Passing text to batch file.
« Reply #6 on: April 04, 2008, 08:31 AM »
brimstone,

I take it you're talking about the LOGECHO.COM in Horst Schaeffer's freeware batch file enhancer collection PBATS?

brimstone

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 7
Re: Passing text to batch file.
« Reply #7 on: April 04, 2008, 01:03 PM »
brimstone,

I take it you're talking about the LOGECHO.COM in Horst Schaeffer's freeware batch file enhancer collection PBATS?


That I am. It allows much better control over the time and date format compared to the %TIME% AND %DATE% variables.

Original address: https://www.donationcoder.com/forum/index.php?topic=12928.0