KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am wanting to start my Java program from a batch file. This is the script I want to use to start the app but the problem is that I am not able to get the console output to redirect to a log file. Can anyone offer any hints without having to edit any code, and by using Java command line options or something? @echo off set TASK=MyApp TITLE %TASK% start javaw.exe -cp .;Server.jar;Util.jar com.manage.Program %1 > log.log 2>&1 taskkill /T /FI "WINDOWTITLE eq %TASK%" So, the above works, and actually kills the cmd window that spawns my Swing app, but it doesn't log anything to the log file, presumably because the "start" forked the process away from the "> log.log 2>&1" arg? I could probably fix it by using start to call another batch file but I am hoping for a more elegant answer.
Tags (comma-separated)
Save Edits
Cancel