0

I have 2 files a.bat and b.bat

The b.bat file looks like this:

exit /b 0

The a.bat file looks like this

call b.bat

Question: what effect does execution of exit /b 0 in b.bat have to a.bat file which does call b.bat assuming we run a.bat?

Trident D'Gao
  • 18,973
  • 19
  • 95
  • 159
  • What did you deduce by yourself when you tried it? Also your question would be better suited to [Super User](https://superuser.com/questions/ask). – Compo Aug 04 '18 at 21:01
  • The effect of executing `exit /b 0` is explained in the help screen of `exit` command. You may read it entering `exit /?` – Aacini Aug 04 '18 at 22:09
  • @Aacini question about how is `call` and `exit` work **together**, not each of them alone which can be read about in helps – Trident D'Gao Aug 04 '18 at 22:24
  • Maybe you can glean something from this question: [How does the Windows Command Interpreter (CMD.EXE) parse scripts?](https://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts) – Squashman Aug 05 '18 at 00:26
  • `call b.bat` command executed in `a.bat` file causes that when `b.bat` ends, the execution returns to `a.bat`. Period. `exit /b 0` command executed in `b.bat` sets `%errorlevel%` to zero and ends `b.bat`. Period. After that, the `%errorlevel%` value in `a.bat` is zero. Perhaps you may want to read the values of **Table 4** at [this answer](https://stackoverflow.com/questions/34987885/what-are-the-errorlevel-values-set-by-internal-cmd-exe-commands/34987886#34987886) – Aacini Aug 05 '18 at 02:21

0 Answers0