Help w Batch file: Monitor another command prompt...

Convert your BATch files into EXEcutable format in one click.
jasell
Posts: 6
Joined: Tue May 06, 2008 8:38 pm

Help w Batch file: Monitor another command prompt...

Post by jasell »

I'm launching several batch file in different windows with:
start program.exe

One is a server that is launched, when it is started I want to launch a client application.

There is message showing in the server window when it is started "...started in...". I want to monitor this window and when this message is printed I want to continue in my "master" batch file. The window is still active so there is not possible to use "start /W".

As for now I have a "pause" statement and an instruction fro the user to monitor the other window.

Any idea on how to do this?
sKurt
Posts: 32
Joined: Mon Jul 23, 2007 5:37 am

Post by sKurt »

Not sure if this is what you are looking for,

but I use two programs that read the processes and let me know if a program/window is running or not

PV.EXE by Igor Nys (5.2.2.7)

and

CLOSEAPP.EXE by Noel Danjou (1.03 (build 9.3)

I have found PV to do most every thing I need, however, there is this one program that it seems to have a problem with so I found CloseAPP.

You can run PV to show if your program is running and run PV -x to wait until the app in question is finished then do the next step, or wait until the app has started to do the next step


PV -x CMD - would wait until it saw the CMD in the title bar then you can
do the next step.


so you could do something like;

PV -x CMD <-- Wait for the window to open

PV ...started in <-- Look for what is running (...Started in

PV -k -f CMD <-- Kill the open window

PV -x CMD <--Wait for the window to close to continue



Maybe?



rambling
jasell
Posts: 6
Joined: Tue May 06, 2008 8:38 pm

Post by jasell »

I don't think this will help.
The process (Jboss) is not finishing, it is still running monitoring any calls to it, and prompting feedback/log info in the cmd-prompt.

The only way I know it is started is that is prompts "...started in xxm:yys" in the cmd-prompt.

What I understand does not the PV monitor what is written but rather what the process is doing or the title of the CMD-prompt (which I cannot change at this position in the cmd-prompt).

I did something like this instead, I'm just conserned that it might consume to much power on a rather meaningless operation...

Code: Select all

&#58;wait
findstr /C&#58;"Started in" "%JBOSS_LOG%"
if ERRORLEVEL 1 goto wait
sKurt
Posts: 32
Joined: Mon Jul 23, 2007 5:37 am

Post by sKurt »

jasell wrote:I don't think this will help.
The process (Jboss) is not finishing, it is still running monitoring any calls to it, and prompting feedback/log info in the cmd-prompt.

The only way I know it is started is that is prompts "...started in xxm:yys" in the cmd-prompt.

What I understand does not the PV monitor what is written but rather what the process is doing or the title of the CMD-prompt (which I cannot change at this position in the cmd-prompt).

I did something like this instead, I'm just conserned that it might consume to much power on a rather meaningless operation...

Code: Select all

&#58;wait
findstr /C&#58;"Started in" "%JBOSS_LOG%"
if ERRORLEVEL 1 goto wait

You can change the title of the window using;


TITLE what ever you put past is now the window title


Are you waiting until the operation is over, or waiting until it starts?
jasell
Posts: 6
Joined: Tue May 06, 2008 8:38 pm

Post by jasell »

It is a JAVA server application that is launching from a command prompt. When the server is up, the process and the command prompt is still active, any server activities are report in the command prompt.

In order to change the title I need to go into the JAVA-code, which I'm not capable of.

I have no problem to change the window title when I'm in batch mode or when launching a new window, but I cannot interupt th process to change the window title.

So what I'm looking for is a way to monitor what is actually prompted in the command prompt and wait for the statement "Started in".

Since I found that the information prompted is also written to a log-file the other solution works. Its just that the loop my consume to much of the processor capacity.
joemark
Posts: 24
Joined: Tue Jan 08, 2008 4:22 pm

Post by joemark »

you may want to look into autoit as should be able to look into program it self.
jasell
Posts: 6
Joined: Tue May 06, 2008 8:38 pm

Post by jasell »

Never heard of it. Tried to find it with google without succes, do you have more information? a link or source?
shodan816
Posts: 8
Joined: Fri Apr 04, 2008 6:52 pm

Here is the URL for Autoit

Post by shodan816 »