Website Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • August 30, 2015, 01:04:52 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Passing text to batch file.  (Read 5401 times)

brimstone

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 7
    • View Profile
    • Donate to Member
Passing text to batch file.
« on: April 03, 2008, 08:58:26 PM »
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
    • View Profile
    • Donate to Member
Re: Passing text to batch file.
« Reply #1 on: April 03, 2008, 11:25:44 PM »
I am curious to know the answer to your question as well :) sorry no help here

brimstone

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 7
    • View Profile
    • Donate to Member
Re: Passing text to batch file.
« Reply #2 on: April 03, 2008, 11:56:03 PM »
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
    • View Profile
    • Donate to Member
Re: Passing text to batch file.
« Reply #3 on: April 04, 2008, 12:01:53 AM »
Is this adding to the end or beginning?

brimstone

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

sshot-2.png

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
    • View Profile
    • Donate to Member
Re: Passing text to batch file.
« Reply #5 on: April 04, 2008, 12:17:58 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
  • ***
  • gravatar avatar
  • Posts: 2,852
    • View Profile
    • Donate to Member
Re: Passing text to batch file.
« Reply #6 on: April 04, 2008, 03:31:17 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
    • View Profile
    • Donate to Member
Re: Passing text to batch file.
« Reply #7 on: April 04, 2008, 08:03:40 AM »
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.