How to run a group of xml in SNAP command line one after another automatically

I have a group of XML files, and these are hard coded. So, I want to run these files automatically one after another in the SNAP command line, and all the XML files are located in the same folder.

  1. open snap command line
  2. gpt path\xxxx.xml
  3. gpt path\yyyy.xml

In matlab, we can write a function to achieve this task.

This is not directly the duty of SNAP. The OS scripting languages can be used for this purpose very well.
Maybe you can adapt the script we have provided here: Bulk Processing with GPT

I usually do shell scripts. You can also do it in Python with

from subprocess import call

If you prefer matlab, you can also call system cammands :