Multiple .bat command in one script

Hi all,
 Iam trying to combine 4 scripts into one .bat file .
Final.bat file looks like below.

@echo off

IF "%1%"=="" GOTo USAGE
IF "%2%"=="" GOTo USAGE
IF "%3%"=="" GOTo USAGE
IF "%4%"=="" GOTo USAGE


C:\test\FtpDownload.bat %1 %2 %3
C:\test\UnzippingDrop.bat %3 %4 %3
C:\test\deployment\install_fixconfigs.cmd dev2
C:\test\CopyDropDev2.bat %3\web
goto END

:USAGE
ECHO.
echo Parameter "filename filedate droppath dropname extractpath website " need to be passed in a sequence.
ECHO.

:END

But when i run final.bat with 4 parameters.
its only able to download files and then show the prompt. It doesnot go to next script.

can somebody help.
sunilbainsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Steve KnightIT ConsultancyCommented:
You need to use CALL command to run another script in this case as otherwise you run another batch file it nevers returns to the first, i.e.

call c:\test\ftpdownload.bat %1 %2 %3

hth

Steve
0
sunilbainsAuthor Commented:
I put call statement as below.
call C:\test\FtpDownload.bat %1 %2 %3
call C:\test\UnzippingDrop.bat %3 %4 %3
call C:\test\deployment\install_fixconfigs.cmd dev2


but its not running 3rd call statment.
After second (which is to unzip file), it returns prompt.
0
Steve KnightIT ConsultancyCommented:
Ok then I imagine in the ftpdownload.bat you have another batch file being called, add a CALL to that too or post the file here if not sure

Steve
0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

sunilbainsAuthor Commented:
Hi Steve,
 call C:\test\FtpDownload.bat %1 %2 %3
call C:\test\UnzippingDrop.bat %3 %4 %3
call C:\test\deployment\install_fixconfigs.cmd dev2

First to calls are runing fine one fater another. but ater second call finishes, it gives prompt .
Second script , just unzip files using 7za.exe.  But after  in unzips, its shows prompt ant doesnot start call to third script.

0
Steve KnightIT ConsultancyCommented:
OK. I meant the second script but as long as it doesn't call another batch file it should continue.  You COULD always run them instead as

START "Downloading..." /WAIT /b C:\test\FtpDownload.bat %1 %2 %3
START "Unzipping..." /WAIT /b C:\test\UnzippingDrop.bat %3 %4 %3
START "Install..." /WAIT /b C:\test\deployment\install_fixconfigs.cmd dev2

or just put them all in together in one batch. I assume you have the filenames right, i.e. the last one you show as a .CMD file and the others .BAT.  Would suggest you make them all .CMD unless there is a reason not to.

Steve
0
sunilbainsAuthor Commented:
Hi Steve,
 I have put them in one bat file called final.bat file
Contents of final.bat is
@echo off

IF "%1%"=="" GOTo USAGE
IF "%2%"=="" GOTo USAGE
IF "%3%"=="" GOTo USAGE
IF "%4%"=="" GOTo USAGE


START "Downloading ..." /WAIT /b  C:\test\FtpDownload.bat %1 %2 %3
START "Unzipping.." /WAIT /b  C:\test\UnzippingDrop.bat %3 %4 %3
START "INSTALL.." /WAIT /b  C:\test\deployment\install_fixconfigs.cmd dev2
goto END

:USAGE
ECHO.
echo Parameter "filename filedate droppath dropname extractpath website " need to be passed in a sequence.
ECHO.

:END

But itsnot running in sequence..

0
Steve KnightIT ConsultancyCommented:
It seems to work for me but I used all .cmd instead of .bat.  Call the main one final.cmd too?  

Might also need to remove the /b which saves the extra cmd.exe windows popping up but sometimes stops it detecting the program has finished.

Steve
0

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
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
Windows Batch

From novice to tech pro — start learning today.