Abyssmedia.com Forum Index Abyssmedia.com
Abyssmedia Support Forums
 
  FAQ    Search    Memberlist    Usergroups   Register 
  Profile    Log in to check your private messages    Log in 

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

 
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler
View previous topic :: View next topic  
Author Message
jasell



Joined: 06 May 2008
Posts: 6

PostPosted: Tue May 06, 2008 8:50 pm    Post subject: Help w Batch file: Monitor another command prompt... Reply with quote

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?
Back to top
sKurt



Joined: 23 Jul 2007
Posts: 32

PostPosted: Wed May 07, 2008 8:43 pm    Post subject: Reply with quote

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
Back to top
jasell



Joined: 06 May 2008
Posts: 6

PostPosted: Thu May 08, 2008 6:56 am    Post subject: Reply with quote

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:
:wait
findstr /C:"Started in" "%JBOSS_LOG%"
if ERRORLEVEL 1 goto wait
Back to top
sKurt



Joined: 23 Jul 2007
Posts: 32

PostPosted: Thu May 08, 2008 4:41 pm    Post subject: Reply with quote

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:
:wait
findstr /C:"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?
Back to top
jasell



Joined: 06 May 2008
Posts: 6

PostPosted: Thu May 08, 2008 7:41 pm    Post subject: Reply with quote

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.
Back to top
joemark



Joined: 08 Jan 2008
Posts: 24

PostPosted: Wed May 28, 2008 12:09 am    Post subject: Reply with quote

you may want to look into autoit as should be able to look into program it self.
Back to top
jasell



Joined: 06 May 2008
Posts: 6

PostPosted: Wed May 28, 2008 6:22 am    Post subject: Reply with quote

Never heard of it. Tried to find it with google without succes, do you have more information? a link or source?
Back to top
shodan816



Joined: 04 Apr 2008
Posts: 8

PostPosted: Wed May 28, 2008 7:13 pm    Post subject: Here is the URL for Autoit Reply with quote

http://www.autoitscript.com/autoit3/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2011 phpBB Group