How to execute the DOS shell script in background?

Have two small DOS shell script in a big DOS script like
Would like to run the two small scripts in parallel like in Unix with &.
Can it be done?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brad HoweDevOps ManagerCommented:
You can do the following.

start cmd.exe /C small1.bat      
start cmd.exe /C small2.bat

Or you can use the "&&" which is a conditional combination. It executes small2 only if small1 completes successfully.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve KnightIT ConsultancyCommented:
Was going to say the same but beaten to it (got called away).  Only thing I'd add is you don't NEED to use the cmd.exe /c construct as it works as well without but START is your answer anyway!

Steve KnightIT ConsultancyCommented:
oh and watch out if you have any spaces in your path.  If you do then

START "some file.cmd"

doesn't work as it starts a window with the title "some file.cmd" as the first parameter in qutoes is the window title. So... you should generall either do:

START "" "some file.cmd"
START "title for this window" "some file.cmd"
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Bill PrewIT / Software Engineering ConsultantCommented:
The START command is likely part of this solution, as mentioned above.  The question I have would be do you want BIG.BAT to continue to process any remaining logic after it starts the two other bat files, and not wait for either to finish?  If so then the START approach above is likely what you are after.

But if you want to run both SMALL1 and SMALL2 in parallel, and not continue on until boght have finished, then that will take a different approach.

Steve KnightIT ConsultancyCommented:
true, and quite messy too potentially!
Brad HoweDevOps ManagerCommented:
Agreed. I would much rather code this in perl using the Parallel::ForkManager :).
jl66ConsultantAuthor Commented:
Thank all of you so much for the info. I will verify each of them.
jl66ConsultantAuthor Commented:
Excellent answers, esp. after all the discussions.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.