{"id":7,"date":"2007-06-22T11:11:36","date_gmt":"2007-06-22T10:11:36","guid":{"rendered":"http:\/\/tom.paschenda.org\/blog\/?p=7"},"modified":"2007-06-22T11:11:36","modified_gmt":"2007-06-22T10:11:36","slug":"calling-one-batch-file-from-another-cascading-batch-files","status":"publish","type":"post","link":"https:\/\/tom.paschenda.org\/blog\/?p=7","title":{"rendered":"Calling one Batch File from another (cascading batch files)"},"content":{"rendered":"<p>When you use batch files in windows xp, you may want to call a set of batch files from another batch file. Let&#8217;s say your file is named foo.bat and looks like this:<br \/>\n<code><br \/>\necho off<br \/>\necho \"Starting foo.bat\"<br \/>\nsubFoo1.bat<br \/>\nsubFoo2.bat<br \/>\necho \"Finished foo.bat\"<br \/>\n<\/code><br \/>\nYou will never see <em>Finished foo.bat<\/em>, since the batch processing will stop after the execution foo1.bat.<\/p>\n<p>To fix this, you need to call the command line processor for each batch file:<br \/>\n<code><br \/>\necho off<br \/>\necho \"Starting foo.bat\"<br \/>\ncmd \/C subFoo1.bat<br \/>\ncmd \/C subFoo2.bat<br \/>\necho \"Finished foo.bat\"<br \/>\n<\/code><\/p>\n<p>Or you can use the <em>call<\/em>-command:<br \/>\n<code><br \/>\necho off<br \/>\necho \"Starting foo.bat\"<br \/>\ncall subFoo1.bat<br \/>\ncall subFoo2.bat<br \/>\necho \"Finished foo.bat\"<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you use batch files in windows xp, you may want to call a set of batch files from another batch file. Let&#8217;s say your file is named foo.bat and looks like this: echo off echo &#8220;Starting foo.bat&#8221; subFoo1.bat subFoo2.bat echo &#8220;Finished foo.bat&#8221; You will never see Finished foo.bat, since the batch processing will stop [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-7","post","type-post","status-publish","format-standard","hentry","category-software-development","category-windows-batch-programming"],"_links":{"self":[{"href":"https:\/\/tom.paschenda.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tom.paschenda.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tom.paschenda.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tom.paschenda.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tom.paschenda.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7"}],"version-history":[{"count":0,"href":"https:\/\/tom.paschenda.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7\/revisions"}],"wp:attachment":[{"href":"https:\/\/tom.paschenda.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tom.paschenda.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tom.paschenda.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}