There is an explanation how to use bataction, also there are related to questions. One of them said:
pls keep in mind that running a batch file from a command prompt is not the same as having it started by another program.
If you run it from a command prompt, the batch file is running in someone’s user context (most likely your own), and you have an environment where you have a bunch of environment variables set for you by Windows.
If you run it from another program, there is no user context, and that might make your batch file fail.
SO here comes a second link, please see this article, might be helpful -