Outbreaker Posted May 10, 2008 Posted May 10, 2008 (edited) HI How can i Run a .cmd file that runs 2 other .cmd files step by step like this:1.cmd -> starts -> 2.cmd -> waits till 2.cmd is finished -> starts -> 3.cmd -> waits till 3.cmd is finished -> exit 1.cmd Edited May 10, 2008 by Outbreaker
Outbreaker Posted May 10, 2008 Author Posted May 10, 2008 I have found the problemThis command is not working:START /WAIT "C:\blabla.cmd"But this one works:START "" /WAIT "C:\blabla.cmd"
Yzöwl Posted May 10, 2008 Posted May 10, 2008 Create the following 3 scripts and put them in C:\1.cmd@Echo off&Setlocal enableextensionsSet "Two=C:\2.cmd"& Set "Three=C:\3.cmd"Echo: This is the calling script, %0&Echo:Echo: When you press any keyEcho: control will be passed to another script, "%Two%".Pause>NulCall %Two% %0Echo:&Echo: You have returned to the calling script again&Echo:Echo: When you press any keyEcho: control will be passed to another script. "%Three%".Pause>NulCall %Three% %0Echo:&Echo: You have returned to the calling script, %0, for the last time&Echo:Echo: When you press any keyEcho: you will exit.Pause>Nul2.cmd@Echo off&Setlocal enableextensionsSet "One=%*"Echo:&Echo: This is a called script, "%0"&Echo:Echo: When you press any keyEcho: control will be passed to the original script, %One%.Pause>Nul3.cmd@Echo off&Setlocal enableextensionsSet "One=%*"Echo:&Echo: This is another called script, "%0"&Echo:Echo: When you press any keyEcho: control will be passed to the original script, %One%.Pause>NulRun 1.cmd to find out how the Call command works.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now