1

Well, I have this program that I run with the help of batch. Its a PHP script that is ran by an EXE file. How can I have it that while the program is running, the output is automatically sent to a file, say log.txt, and have the output simultaneously shown on screen?

I tried something like program.exe >> log.txt, but that didnt show output on the screen.

1

2 Answers 2

1

If you want to do it only with windows commands may be you should try something like this:

program.exe > %temp%\temp.log
type %temp%\temp.log
type >>  log.txt
@del %temp%\temp.log /S /Q

there is no tail equivalent in windows commands.

Sign up to request clarification or add additional context in comments.

Comments

1

By 'show output on the screen' do you mean updating the file contents on an already opened screen/console window.

If yes, you can use the following command

tail -f log.txt

Please note that 'tail' is not available with base installation of windows, but you can download it (free). look for unixUtils for windows.

1 Comment

Thanks, but I need a native solution.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.