Solved

What is the exact difference between "Start" and "call" (batch file) ?

Posted on 2011-02-12
3
5,786 Views
Last Modified: 2012-05-11
What is the exact difference between "Start" and "call" ?


zmau
0
Comment
Question by:zmau
3 Comments
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 45 total points
ID: 34878758
start reference: http://www.computerhope.com/starthlp.htm
call reference: http://www.computerhope.com/call.htm

call is to start another batch program, with some side effects (another EXIT required)
start runs the other application, with many options that control the environment ...
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 80 total points
ID: 34878888
To add to the above:
start allows for running the called script/application in parallel (if usually not running detached), and to explicitely wait for termination for applications which usually run detached.
call is only useful (and necessary) if you want to call other .cmd/.bat files. Else you do not need to use call.

Examples:
REM --- Script-one.cmd ---
@echo off
echo Script one
call Script-two.cmd
echo Script one again
exit /b

REM --- Script-two.cmd ---
@echo off
echo Script two
exit /b

Open in new window

Running that wil have the desired result. Script one is calling script two, and script one continues after script two has finished.
Omitting the CALL statement, only using
   Script-two.cmd
will execute script two, but not return to script one.

   call Notepad.exe
and
   Notepad.exe
are the same. Because Notepad is an application, not a batch file, the call is optional.
In both cases notepad is opened, but the calling script continues.

   start /wait Notepad.exe
will start a notepad, and wait until termination.
0
 
LVL 1

Author Comment

by:zmau
ID: 34878903
Thanks
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question