1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

batch output logging and display

Discussion in 'Software Development' started by SGT_awesomesauce, Aug 8, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. SGT_awesomesauce

    SGT_awesomesauce Thread Starter

    Joined:
    Aug 8, 2009
    Messages:
    6
    Hi,
    I am making a script that will update my games svn addons automatically and i am trying to make it output to a log file while still showing everything on the console. any help is appreciated.
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,731
    yourbatch.bat >output.log >con
     
  3. SGT_awesomesauce

    SGT_awesomesauce Thread Starter

    Joined:
    Aug 8, 2009
    Messages:
    6
    thanks, so i can get rid of the append commands in the original right?
     
  4. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,731
    Yes.
    By launching your batch file this way we are redirecting stanadard output to a text file and the console.
     
  5. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,731
    Ah hold on. That's not right.
     
  6. SGT_awesomesauce

    SGT_awesomesauce Thread Starter

    Joined:
    Aug 8, 2009
    Messages:
    6
    so i tried it and everything came out fine on the console but only what i edited to have only >output.log showed up on my logfile. btw im running vista 64 if that makes diff
     
  7. SGT_awesomesauce

    SGT_awesomesauce Thread Starter

    Joined:
    Aug 8, 2009
    Messages:
    6
    ya it just puts it to the logfile and then takes it back out
    mabye a print statement?
     
  8. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,731
    You can't redirect console output in batch without a 3rd party utility. In the unix world we would use TEE. There are windows ports of TEE to do this.
     
  9. SGT_awesomesauce

    SGT_awesomesauce Thread Starter

    Joined:
    Aug 8, 2009
    Messages:
    6
    i found something that works. i attached the zip file. thanks for your help
     

    Attached Files:

    • tee.rar
      File size:
      20.6 KB
      Views:
      66
  10. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,731
  11. SGT_awesomesauce

    SGT_awesomesauce Thread Starter

    Joined:
    Aug 8, 2009
    Messages:
    6
    ok thanks well its all working great now.
     
  12. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/850354