Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

920 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

15 Experts available now in Live!

Get 1:1 Help Now