Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Running program only works once in a BAT file

0 views
Skip to first unread message

Barry Sheward

unread,
Jun 20, 1999, 3:00:00 AM6/20/99
to
Hi,

I have a BAT file which executes another BAT file twice (with different
parameters). The problem is that my BAT file manages to run the first BAT
file, but exits before the second is executed.

Using CALL makes absolutely no difference, so I tried using START, but in
this case, I just get a Command Window with a prompt which never exits. Does
anyone know what is going on?

The first command must complete before I start the second command. The BAT
file which I am calling is not written by me, and I would rather not have to
modify it. It is shown below:

@echo off

perl -S perlfile.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
if errorlevel==1 goto ChkPrl
goto endf

:ChkPrl
perl -v >NUL
if errorlevel==1 echo can't find perl
goto endf

:endf

Thanks in advance!

Barry Sheward
barrys...@yahoo.com

Bruce Patin

unread,
Jun 30, 1999, 3:00:00 AM6/30/99
to
When one bat starts another, the new bat replaces the first bat. It does not
return. It's always been that way. Since I've noticed that you use Perl, your
best bet is to write a Perl script to do what your bat is trying to do.

Sylvan Butler

unread,
Jun 30, 1999, 3:00:00 AM6/30/99
to
On Wed, 30 Jun 1999 12:40:44 GMT, Bruce Patin <pa...@iamdigex.net> wrote:
>When one bat starts another, the new bat replaces the first bat. It does not

Not always. Usually using 'call' sets up a stack... I use it like that
every day.

>Barry Sheward wrote:
>> I have a BAT file which executes another BAT file twice (with different
>> parameters). The problem is that my BAT file manages to run the first BAT
>> file, but exits before the second is executed.
>>
>> Using CALL makes absolutely no difference, so I tried using START, but in

That is strange. I see nothing in your second batch file to cause that
behavior. What does the top level batch file look like? (you can
e-mail me directly if you like)

sdb
--
| Sylvan Butler | Not speaking for Hewlett-Packard | sbutler-boi.hp.com |
| Watch out for my e-mail address. Thank UCE. #### change ^ to @ #### |
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. --Benjamin Franklin, 1759
"Don't Tread On Me!"

Phat

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
thats why you "call" the other batch file. Then it will continue where it
left off


sandeman

unread,
Jul 3, 1999, 3:00:00 AM7/3/99
to
Please have a look at KIXTART, it probably can do everything you want,
including calling batfiles

Regards,

sandeman

Bruce Patin <pa...@iamdigex.net> wrote in message
news:377A11A8...@iamdigex.net...


> When one bat starts another, the new bat replaces the first bat. It does
not

> return. It's always been that way. Since I've noticed that you use Perl,
your
> best bet is to write a Perl script to do what your bat is trying to do.
>
> Barry Sheward wrote:
>
> > Hi,
> >

> > I have a BAT file which executes another BAT file twice (with different
> > parameters). The problem is that my BAT file manages to run the first
BAT
> > file, but exits before the second is executed.
> >
> > Using CALL makes absolutely no difference, so I tried using START, but
in

GHouck

unread,
Jul 3, 1999, 3:00:00 AM7/3/99
to

If you CALL the batch file, it will return; that is:

...
CALL mybatch.cmd
...

And, in NT, you should use .CMD files, because I think
.BATs start up as 16-bit NTVDM windows (not absolutely
sure on that, though.)

Yours,

Geoff Houck
systems hk
hk...@teleport.com
http://www.teleport.com/~hksys

0 new messages