'Why change of sequence in cmd command gives different result?

I'm new in using cmd and batch script. Here is what I was trying to do with a .bat file.

  1. go to a folder
  2. open that folder in file explorer
  3. open that folder in vscode
  4. start Firefox browser

Sequence doesn't matter here. Doing these tasks in any sequence is fine.

Here are the commands that I initially wrote

cd/
E:
cd folder1/folder2/folder3
code .
start .
start firefox

But with these commands the result I got is

  1. Only vscode started with the folder I wanted to open with vscode
  2. File explorer and Firefox was not starting
  3. cmd.exe continued to run. But it seems like it only executed upto code . command
  4. When I closed vscode, cmd.exe would be closed with it too

Then I changed the sequence of the commands as below

cd/
E:
cd folder1/folder2/folder3
start .
start firefox
code .

This time everything worked as expected. I've looked up documentation for start command but didn't find anything(or maybe I didn't understand) about start . command.
Can anyone explain me why the result changed when I changed the sequence of the commands?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source