yingchai wrote:
Here is the code for test.bat file:
Now, if you start the TM1 model using the application shortcut, the TI will probably able to trigger the .bat file.
Next, try to start the TM1 model as a service and see what you get.
I've got a better idea.
How about instead of trying to echo to a screen from a service (which is not supposed to have a user interface) on a server (which will not normally have anyone logged on to see such an interface anyway)... you try redirecting that output to a
file instead to determine whether the batch file is actually running?
Because my bet is that it IS actually running, and that if you consult the server's Task Manager and watch it reeeeal close... an extra cmd.exe session will pop up in the Details tab every time you run the process that calls the batch file, and it's just that the window, like the service itself, is not visible to you.
Except I wouldn't do that too often if I were you, because chances are you already have a raft of cmd.exe sessions running on the server, sessions which will not die until the server reboots because they're waiting in vain for a keystroke that will never come.
Needless to say, leave the "Pause" out of the batch file and go and take a look at the output file to confirm that it ran.