Run a Batch file using Task Scheduler on a Terminal Server

Have you ever needed to run a task on a terminal server?  I have many times.  In one particular case we needed to run a batch file within the Task Scheduler but were having inconsistent issues when the particular user account was not logged onto the server.  The task refused to run even if the designated properties were set on the task scheduler itself.

After extensive logging I was able to determine the exact issue and then had to determine a fix.  Although not as straight forward as one would hope this did resolve the issue for the application we were trying to launch.  In some instances this may not be required but for us in order to launch WinSCP it was.


  1. Create your task in Task Scheduler with the following options

2. From the Run command type “gpedit.msc” this will open the local policy settings.  Navigate to the following location, then double click on “Log on as a batch job”

3. Add the user to this listing that is set to run the task within Task Scheduler.  This will allow the task to run the task whether the user is logged in or not.

4. Finished!  Your task should run properly with or without the user being logged in.


1 comments On Run a Batch file using Task Scheduler on a Terminal Server

  • May I just say what a relief to uncover somebody who genuinely knows
    what they are discussing over the internet. You actually know how to bring a problem to light and make it important.
    More and more people ought to read this and understand this side of your story.
    I can’t believe you aren’t more popular since you definitely have the gift.

Leave a reply:

Your email address will not be published.

Site Footer