# how to invoke a series of long running commands in the background and at a low priority _clb_ - Windows NT

This is a discussion on how to invoke a series of long running commands in the background and at a low priority _clb_ - Windows NT ; Hi... I'm not a DOS .bat file expert, but (perhaps foolishly) I'm stil trying to do something a bit tricky... I want to run (under windows XP) a series of long running commands in the background and at a low ...

# Thread: how to invoke a series of long running commands in the background and at a low priority _clb_

1. ## how to invoke a series of long running commands in the background and at a low priority _clb_

Hi...

I'm not a DOS .bat file expert, but (perhaps foolishly) I'm stil trying
to do something a bit tricky...

I want to run (under windows XP) a series of long running commands in
the background and at a low priority (so as not to slow down my
foreground tasks). I want to capture the output of the execution of
this series of commands in a file. The commands are themselves .bat
files (scripts).

My problem is that the 'launch in the background at low priority'
script that I created 'hangs' after each statement... it only continues
if i manually type 'exit' for however many statements i am trying to
execute in the script.

Example...>>>

For simplicity, let say i have a script 'replay.bat' in d:\temp that i
want to run twice with different argumetns.

d:\temp\replay.bat:
echo replaying %1

The best i could come up with for a
'launch in the background at low priority' script is as follows:

d:\temp\launchThem.bat
start /B /w /BELOWNORMAL d:\temp\replay do-first
start /B /w /BELOWNORMAL d:\temp\replay do-second

when i run this script i see

do-first

printed out.. but then i just get another dos prompt.
If i type exit at that prompt, then i finally see
"do-second"

I'm wondering what I need to do to change my script so that there is no
'wait' in between the two executions of 'replay.bat'. Note: I think I
need the /B because I don't want my output to go to another window..
also, I think I need the /w because my commands need to run serially.
thanks
-chris

2. ## Re: how to invoke a series of long running commands in the background and at a low priority _clb_

wrote in message
> Hi...
>
> I'm not a DOS .bat file expert, but (perhaps foolishly) I'm stil trying
> to do something a bit tricky...
>
> I want to run (under windows XP) a series of long running commands in
> the background and at a low priority (so as not to slow down my
> foreground tasks). I want to capture the output of the execution of
> this series of commands in a file. The commands are themselves .bat
> files (scripts).
>
> My problem is that the 'launch in the background at low priority'
> script that I created 'hangs' after each statement... it only continues
> if i manually type 'exit' for however many statements i am trying to
> execute in the script.
>
> Example...>>>
>
> For simplicity, let say i have a script 'replay.bat' in d:\temp that i
> want to run twice with different argumetns.
>
> d:\temp\replay.bat:
> echo replaying %1
>
>
> The best i could come up with for a
> 'launch in the background at low priority' script is as follows:
>
> d:\temp\launchThem.bat
> start /B /w /BELOWNORMAL d:\temp\replay do-first
> start /B /w /BELOWNORMAL d:\temp\replay do-second
>
>
> when i run this script i see
>
> do-first
>
> printed out.. but then i just get another dos prompt.
> If i type exit at that prompt, then i finally see
> "do-second"
>
> I'm wondering what I need to do to change my script so that there is no
> 'wait' in between the two executions of 'replay.bat'. Note: I think I
> need the /B because I don't want my output to go to another window..
> also, I think I need the /w because my commands need to run serially.
> any advice much appreciated !
> thanks
> -chris
>

You could try this:

start /B /w /BELOWNORMAL cmd.exe /c d:\temp\replay do-second