New
#1
Starting an app in task scheduler as admin
I have an EXE that runs an agent that is used to connect to QuickBooks Desktop on a Windows 10 computer. The requirements are that the agent EXE and the QuickBooks EXE are the same bitness(x64) and are opened using the same username.
The agent has a UI EXE that when launched as admin pops up a window. From there I can confirm that the agent is working correctly. Then I can launch QUickBooks as administrator and the agent connects to QuickBooks successfully.
This connection is all part of a replication that would happen after hours, so it would need to run via scheduled jobs.
Without needing any info about the agent, the issue is when I try to use the task scheduler and start the agent in the job (as admin), it will work fine if I check 'Run only when user is logged in' This opens the UI EXE just as if you double click it. If I check 'run whether the user is logged in or not', it opens the UI EXE in the background. I can confirm the agent is functioning correctly, but it wont connect to QuickBooks. the only difference is running in the background.
My question is - are permissions changed when an app is opened with 'run whether the user is logged in or not' vs. 'Run only when user is logged in'? That is the only difference I am seeing.
My goal is to have the task scheduler run these jobs in the middle of the night so the replication can happen off hours. Hence, all permissions and opening of files needs to be handled through the task scheduler.
There is also the possibility to run these agent EXEs as a service. If I run the same EXE as a service as admin, its the same result as running in task scheduler as 'run whether the user is logged in or not'
Would it be better to just execute a BAT file from the task scheduler that opens the EXE UI?