I have a script that prints a lot of information, but also requires user input.
I need to be able to see the display in the command window, but also have it print the output on the screen to a log file.
-------------------------------
Info Here
-------------------------------
What is your favorite color? Blue
You sad your favorite color is "Blue".
Executing: AttackByBunny.exe
I'd prefer a way that can be set at the very top and apply to everything following.
SET ECHO OFF
SET FILEOUTPUT FILE.log
exec monty.exe
UPDATE for attempting w/ jtee.bat:
This doesn't seem to work for the script below.
It just exits on the call mvn ...
line.
The pauses are just for debugging purposes.
UPDATED Script:
@echo off
set RELEASE_BRANCH=PROD_Release_7_0
echo Using NON_PROD_ENV/%RELEASE_BRANCH% | jtee.bat %RELEASE_BRANCH%.log
pause
if exist %RELEASE_BRANCH% (
echo Running svn update %RELEASE_BRANCH% | jtee.bat %RELEASE_BRANCH%.log 1
svn update %RELEASE_BRANCH% | jtee.bat %RELEASE_BRANCH%.log 1
) else (
echo Running svn co https://svn_rep/branches/releases/NON_PROD_ENV/%RELEASE_BRANCH% | jtee.bat %RELEASE_BRANCH%.log 1
svn co https://svn_rep/branches/releases/NON_PROD_ENV/%RELEASE_BRANCH% | jtee.bat %RELEASE_BRANCH%.log 1
)
pause
cd %RELEASE_BRANCH%
pause
call mvn clean release:clean release:prepare -DpreparationGoals="install" -DcompletionGoals="install versions:use-next-snapshots versions:commit" -Darguments='-Dmaven.test.skip=true' | jtee.bat ../%RELEASE_BRANCH%.log 1
pause