Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

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


zmau
0
Comment
Question by:zmau
3 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 180 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 71

Accepted Solution

by:
Qlemo earned 320 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

783 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