Go Back   Cyber Tech Help Support Forums > Operating Systems > Older Windows Versions > Windows 98

Notices

Reply
 
Topic Tools
  #1  
Old September 29th, 2002, 05:13 PM
Dopey Dopey is offline
Member
 
Join Date: Sep 2002
Posts: 45
Another Bat Question

Before I do this I need to get a little more information about how bat files work. I have four bat files that I want to run one after another. Can I use the call command in file 1 to start 2,3, and 4?
For example:

File 1: @echo off
my bat file
call bat file 2
call bat file 3
call bat file 4
exit

All files run in dos instead of windows so will this work? Exit is the last line in all my bat files but I was wondering if the call function worked similiar to the gosub/return function. After file 2 completes will control return to file 1 and continue with the next line which is to execute file 3 and so on? Or am I just getting batty? Thanks all.

-John
Reply With Quote
  #2  
Old September 29th, 2002, 08:32 PM
enat66's Avatar
enat66 enat66 is offline
CTH Subscriber
 
Join Date: Dec 2001
O/S: Windows Vista
Location: Wisconsin
Age: 19
Posts: 3,089
why don't just create 1 big batch file?
__________________

Reply With Quote
  #3  
Old September 29th, 2002, 10:33 PM
Dopey Dopey is offline
Member
 
Join Date: Sep 2002
Posts: 45
I'm experimenting.
Reply With Quote
  #4  
Old September 29th, 2002, 11:38 PM
enat66's Avatar
enat66 enat66 is offline
CTH Subscriber
 
Join Date: Dec 2001
O/S: Windows Vista
Location: Wisconsin
Age: 19
Posts: 3,089
I know but i see no practical person in doing what you are trying to do.
__________________

Reply With Quote
  #5  
Old September 30th, 2002, 02:33 AM
WhitPhil WhitPhil is offline
Member
 
Join Date: Aug 2002
Posts: 81
It allows you to build common batch files that can then be called from other batch files. Ie: The Modular progamming concept.

Dopey:
Yes the CALL is the way to do it.

BTW You could easily confirm this yourself. There are 2 useful DOS debugging commands: ECHO and PAUSE

For example, if you create batch file 1 with
Call File2.bat
Call File3.bat


And then in file 2
Echo File 2
Pause


And in File 3
Echo File 3
Pause


When you start File 1, you can then see what actually happens.
Reply With Quote
  #6  
Old September 30th, 2002, 02:34 PM
Dopey Dopey is offline
Member
 
Join Date: Sep 2002
Posts: 45
Thank you WhitPhil. Works great.

-John
Reply With Quote
  #7  
Old September 30th, 2002, 09:34 PM
enat66's Avatar
enat66 enat66 is offline
CTH Subscriber
 
Join Date: Dec 2001
O/S: Windows Vista
Location: Wisconsin
Age: 19
Posts: 3,089
Oh i see.
__________________

Reply With Quote
Reply

Bookmarks

Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:05 PM.

[ RSS ]