Automation – Running a Batch File from Task Scheduler Without User being logged In

At some point you will probably need to automate some of your work, and using Windows Task Scheduler if perfect for this. If you do this on a server you will have to make sure that your server will wake up to run the task, and that your credentials is added.

This is an easy guide to do just that. Watch it on youtube

For this sample I will have a batch file like this:

set datetimef=%date%_%time:~0,2%-%time:~3,2%-%time:~6,2%
set datetimef=%datetimef: =0%
echo "success" %datetimef% >> c:\temp\test.log

Put this on a temp folder on you C drive. Make sure you don’t have this on your desktop, that will not work for security reasons.

Here are the steps:

1. Open Task Schedular in Windows and “Create a Basic Task”


Click next until you get to the “Action” selection.

2. Select “Start a Program”


Make sure you add the “Start in (optional)” path without the last “\” in you path.
Click next >> Finnish and then open properties for your task.

3. Make sure you select the option “Run whether user is logged in or not” and “Run with highest privileges”


4. Go to Conditions tab and make sure you check “Wake the computer to run this task”


That’s it.

Thanks for reading