How to make one batch file from three

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
vanekgy
Posts: 2
Joined: 08 Sep 2015 07:09

How to make one batch file from three

#1 Post by vanekgy » 08 Sep 2015 07:16

Dear topic Members

Can i make one batch file from three? Here is the 3 batch files.:

tpo.bat(this need to be the first)

robocopy D:\ftp\TPO\y\Kozos\tpo y:\tpo /mir /r:1 /W:1 /log:c:\cmd\robocopy_tpo.log

second: szallitolevel.bat

robocopy "y:\Leigazolt szallitolevelek" "d:\ftp\tpo\y\Kozos\Partnerek\Leigazolt szallitolevelek" /mir /r:1 /W:1 /log:c:\cmd\robocopy_szallitolevel.log

third: megrendeles.bat

robocopy y:\megrendeles d:\ftp\tpo\y\kozos\megrendeles /mir /r:1 /W:1 /log:c:\cmd\robocopy_megrendeles.log


Thanks for any help :wink:

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: How to make one batch file from three

#2 Post by Squashman » 08 Sep 2015 07:24

Yes. Just put all three lines of code into one batch file.

vanekgy
Posts: 2
Joined: 08 Sep 2015 07:09

Re: How to make one batch file from three

#3 Post by vanekgy » 08 Sep 2015 07:42

did not work... :?

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: How to make one batch file from three

#4 Post by Squashman » 08 Sep 2015 08:13

vanekgy wrote:did not work... :?


That really does not tell us much at all. We are not omniscient. You are going to have to describe what is going on.

Putting all three lines of code into one batch file should be no different. There would be absolutely no point to have batch scripts or any other type of scripting language if you could not put more than one line of code in them.

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: How to make one batch file from three

#5 Post by dbenham » 08 Sep 2015 11:07

The other option is to create a master script that CALLs the three smaller ones.

master.bat

Code: Select all

call tpo.bat
call szallitolevel.bat
call megrendeles.bat



Dave Benham

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: How to make one batch file from three

#6 Post by foxidrive » 08 Sep 2015 18:47

vanekgy wrote:did not work... :?


To echo what Squashman has said:

We need to know why it did not work, to figure out where you went wrong.
Things like what you saw on the screen, error messages that appeared.

It can be as simple as using the wrong name for the batch file - but to know
that we need details of what happens/what you did.

Post Reply