Solved

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

Posted on 2011-02-12
3
6,114 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 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