Solved

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

Posted on 2011-02-12
3
5,368 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 68

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Unlike scripting languages such as C# where a semi-colon is used to indicate the end of a command, Microsoft's VBScript language relies on line breaks to determine when a command begins and ends. As you can imagine, this quickly results in messy cod…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now