I am looking for this kind of shell scripting equivalent in Heroku dynos.
start cmd /k call "batch1.bat"
start cmd /k call "batch2.bat"
. batch1.sh &
. batch2.sh &
You can spin up a heroku one-off dyno, as follows:
heroku run bash
This gives you an interactive bash shell, from which you can invoke any script in your git repo.
You can also, of course, run "batch" scripts directly, e.g:
heroku run bash -c "ls -lt"
That will spin up a one-off dyno instance, whose bash shell will run whatever command was passed to it, in this case, "ls -lt". After completing the command, the one-off dyno shuts down.
Note that as with all Heroku dynos, the filesystem is ephemeral, so any files created by your script will be gone after your one-off dyno exits.