The Computer Oracle

Why use start over call when using batch files?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2 Looping

--

Chapters
00:00 Why Use Start Over Call When Using Batch Files?
00:17 Accepted Answer Score 15
01:05 Answer 2 Score 3
01:16 Thank you

--

Full question
https://superuser.com/questions/466682/w...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows #batchfile

#avk47



ACCEPTED ANSWER

Score 15


call runs the given script inside the same interpreter instance, so it can only be used for batch files, but it allows the called script to modify the caller's environment using set. In Windows NT, call also allows labels to be called as subroutines; e.g. call :foo.

On the other hand, start uses the ShellExecute() function, so it can be used to open practically everything Windows itself can open, including documents, other files, and even Internet URLs. start also has options to open a separate console window, to use different process priorities, and to run a program without waiting for it to finish. However, if you use start with a batch file, it will run in a separate interpreter, and any modifications to the environment will not be seen from the caller.




ANSWER 2

Score 3


C:\>start /?
Starts a separate window to run a specified program or command.

C:\>call /?
Calls one batch program from another.

Call will not start new window and can be used to call labeled subroutine.