Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Batch File Q

  • 30-07-2007 3:12pm
    #1
    Registered Users, Registered Users 2 Posts: 490 ✭✭


    Hi Guys,
    I have a small batch file thats spits a load of output onto the screen, its somethign like this....

    @echo off
    call makebuilda.bat
    call makebuildb.bat
    call copybuild.bat
    pause

    In order to get it to write this output to a file I changed it to
    @echo off
    call makebuilda.bat >file.txt
    call makebuildb.bat >>file.txt
    call copybuild.bat >>file.txt
    pause

    Good news is it more or less works,
    Bad news is it no longer displays the output on the command window

    How do I get both to work?


Comments

  • Closed Accounts Posts: 68 ✭✭nuada


    remove @echo off


  • Registered Users, Registered Users 2 Posts: 490 ✭✭delop


    nuada wrote:
    remove @echo off

    Thats not suitable because it outputs everything including variables etc ...


  • Registered Users, Registered Users 2 Posts: 1,375 ✭✭✭Shane O' Malley


    Can you run both, one with the redirection and one without.

    Doubles the work, but may suit.

    Other than that, all i can think of is a redirect within the batch file you are calling to echo to CON


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,567 Mod ✭✭✭✭Capt'n Midnight


    Not what you want but..
    [php]
    @echo off
    call makebuilda.bat >file.txt
    type file.txt
    call makebuildb.bat >>file.txt
    type file.txt
    call copybuild.bat >>file.txt
    type file.txt
    pause[/php]

    or notepad file.txt and re-open

    But yeah it would be handy having an app that could input a stream , display the live stream and pipe it to the file too.
    I'm sure you could do it with SED but there must be an easier way


  • Registered Users, Registered Users 2 Posts: 21,499 ✭✭✭✭Alun


    But yeah it would be handy having an app that could input a stream , display the live stream and pipe it to the file too.

    Unix's tee command does exactly that.

    Win32 versions of that and a load of others available at http://gnuwin32.sourceforge.net/summary.html Installing these means installing loads of support stuff such as libraries as well, so you may prefer a standalone versions of that one program. If you Google tee.exe you'll find loads .. here's one http://www.csc.calpoly.edu/~bfriesen/software/files/tee32.zip


  • Advertisement
Advertisement