How to run batch files from bat file?

B

brett

I have two batch files that run fine. I want to create a new batch
file, RunAll.bat, that will run these batches. I put only two lines
in RunAll.bat (just the name of each bat file). When I run RunAll.bat,
only the first batch file runs. Is there a way to get both to run?

Thanks,
Brett
 
D

David H. Lipman

From: "brett" <[email protected]>

| I have two batch files that run fine. I want to create a new batch
| file, RunAll.bat, that will run these batches. I put only two lines
| in RunAll.bat (just the name of each bat file). When I run RunAll.bat,
| only the first batch file runs. Is there a way to get both to run?
|
| Thanks,
| Brett

Example:

@echo off
%comspec% /c c:\1.bat
%comspec% /c c:\2.bat
 
P

Pegasus \(MVP\)

David H. Lipman said:
From: "brett" <[email protected]>

| I have two batch files that run fine. I want to create a new batch
| file, RunAll.bat, that will run these batches. I put only two lines
| in RunAll.bat (just the name of each bat file). When I run RunAll.bat,
| only the first batch file runs. Is there a way to get both to run?
|
| Thanks,
| Brett

Example:

@echo off
%comspec% /c c:\1.bat
%comspec% /c c:\2.bat

This is Windows 98 technology. Under Win2000/XP it
is sufficient to do this:

@echo off
call c:\1.bat
call c:\2.bat
 
D

David H. Lipman

|
| This is Windows 98 technology. Under Win2000/XP it
| is sufficient to do this:
|
| @echo off
| call c:\1.bat
| call c:\2.bat
|

Yes creating a daughter process through the Command Interpreter chaining the batch file is
old but it provides a wider compatibility.

As per using the 'call' statement, it is much more of an eloquent solution for a NT based OS
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top