We have a few VB applications that run nightly and are started from Task Scheduler on a server. Those applications start, they do their thing, then close/end themselves, per code in the EXE itself.
I have a new one that I have set to start exactly like the others, but this one hangs once Task Scheduler starts it. See ScreenCapTaskMgr1.JPG
In all cases, the Task Scheduler actually calls a .CMD (batch) file, and in the batch file is the command to start the EXE. Similar to the others, the batch file for the one that does not work looks like this (shortened to 1 line for for testing):
start /d "E:\corpapps\Burns TSYS Batch" BurnsTSYSBatch.EXE
The Task Scheduler calls the task as in ScreenCapTask2.jpg
All the other tasks are set to "Run whether user is logged on or not" and work fine, and this is the preferred setting. The new EXE will run properly (not hang) only if this setting is set to "Run only when user is logged on". See ScreenCapTask1.jpg
I can't blame the batch file -- If I run the batch file directly (double-click it) the EXE starts and closes itself, as it should.
different about this EXE is that it includes an ActiveX control that the others don't. But, I reiterate here that the EXE runs fine on the server if I just double-click it, or double-click the .CMD file that starts it.
The EXE has a log file that it writes to immediately upon starting, and I noticed that when it hangs, it never writes to that file -- so it's not making it far through the code before hanging.
So, perhaps when the EXE is started as "Run whether user is logged on or not", it is actually executing in a "user space" that does not have the ActiveX registered? I am logged in as Administrator, so you'd think there's not an "authority" issue.