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
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!"
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
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