7 Nerdy Things You Can Automate with the Windows Task Scheduler

The Windows Task Scheduler has to be one of the most convenient and useful legacy tools Microsoft ever invented, and in this article I’ll show you seven reasons why that’s true.

Oh, sure, you could use the Windows scheduler to schedule all of those boring tasks that everyone does, like defragging your hard drive or cleaning up temporary files, but what fun is that?

Why not do something that’s actually useful, like send an automated email, issue an automated Facebook post or Tweet, or kick off some music or a video in the morning to help you wake up when your alarm clock doesn’t do the trick?

I’ll show you how to do these things and more in this article.

1. Send an Automated Email

You’re a busy person, and a lot of that busy-work usually involves things like sending people status updates or emailing your boss a report. So, why not automate the sending of information via email and remove that from your to-do list?

Here’s an example: I need to send out a performance report to my staff each month.

task-schedule1

This report is stored in a Word Document in c:\users\ryan\documents\muo documents\muo-report.docx.

While I could take the time every single month to write up that email from scratch and type the report data right into the email, why not just generate the report document by the 14th of the month, and have an automated script send the email with the Word document attached?

task-schedule2

Of course, this isn’t just a simple batch job you can run to accomplish this. You’ll need to set up SendEmail on your PC for this to work. Download SendEmail, and then use my guide to set it up.

Once you’re ready, it’s time to create the scheduled task so you can send your email on a fixed schedule. To use SendEmail with a service like Gmail, you just navigate to the folder where you saved the sendemail.exe file, and type the following command:

sendEmail -o tls=yes -f [email protected] -t [email protected] -s smtp.gmail.com:587 -xu [email protected] -xp YOURPASSWORD -u "Hello from sendEmail" -m "How are you? I'm testing sendEmail from the command line."

You’ll also have to add an “-a” parameter to attach a file (I’ll show you below). Now that you can send emails in command line format, you can use a scheduled task to send out your report on a schedule!

I’ll walk you through creating a task in this first step – in subsequent sections below, I’ll assume you know how to create and schedule the task.

First, launch the Task Scheduler by (in Windows 10) clicking the Start button, clicking All Apps, and typing “schedule“, then choose Task Scheduler from the list of apps. Once the main windows comes up, choose Create Task…

task-schedule3

Next, name your task. In this case I’ll call it “Send MUO Report”. It’s also going to run under my user account, but if you have multiple users on a PC and they want their own scheduled tasks, make sure the correct user is selected.

task-schedule4

On the Triggers tab, set up the schedule when you want your emails to get sent. In this example, I’m going with the 15th of the month, every single month.

task-schedule5

The Action tab is where the magic happens. This is where you’ll tell the Task Scheduler to run sendEmail.exe (wherever you’ve saved it), and then in the Add arguments (optional) field is where all of the additional parameters go.

task-schedule6

One more important setting to check is on the Conditions tab.

task-schedule8

Make sure that Wake the computer to run this task is selected, or if you walk away from the computer for a while and it wants to send this email for you automatically, it won’t be able to.

Once this task runs, you’ll see the email appear in your inbox with the file attached.

task-schedule7

The only trick now is to remember to update that Word document before the date comes when the email gets sent!

That’s all there is to it! Now that you can schedule sending emails to people, with files attached, just think of all of the possibilities!

2. Open and Organize Your Browser

Whenever I first wake up in the morning, after grabbing a cereal or some other easy breakfast, I usually fire up the laptop and open up my favorite tech news sites.

Wouldn’t it be cool if your computer just opened up your browser, and all your favorite news websites, first thing in the morning and all on its own? Well, it’s possible.

Just set up the task as described above. Set the trigger for every day at 8 am (or whenever you get up), and set the trigger like this.

task-schedule10

Here’s how you do it. In the Program/script: field, you browse to the location of the browser executable. In this case, that’s Chrome.exe. It could just as well be Firefox or any other browser.

The Add arguments (optional): field contains the parameters. The parameters are basically all of the web pages you want the browser to open automatically for you. So, if you type, “https://www.makeuseof.com/wp-admin/ https://news.google.com/ https://mail.google.com” (each separated by a space) – the browser will launch and open those three websites.

task-schedule11

This is one of the simplest and fastest ways to let your computer do all the heavy lifting in the morning, and all you have to do is sit back and enjoy a few websites while you sip on your coffee.

3. Journal How You’re Feeling Every Day

Rob has written before how important journaling is, but it’s also one of the easiest things to forget to do every day. That’s why using your Windows Task Scheduler for something like this is a no-brainer!

To set this up, you’ll need to make use of a Visual Basic Script (VBS) saved somewhere on your computer where you can call it from the Task Scheduler. The VBS script will basically prompt the user (you) for your journal inputs, and then it’ll append those to a CSV file that’ll store the log of your daily stats.

Here’s the script. Just copy and paste it into a text file and save it as “logtoexcel.vbs”.

Option Explicit

Dim strMood
Dim strWeight
Dim strExercise
Dim strDiet

' Prompt for mood, weight, exercise, diet

strMood = Inputbox( "Happiness Level (1-10):" )
strWeight = Inputbox( "Enter today's weight:" )
strExercise = Inputbox( "How many minutes did you work out?:" )
strDiet = Inputbox( "Do you feel like you ate well today?:" )

Dim objFSO, objFolder, objShell, objTextFile, objFile
Dim strDirectory, strFile, strText
strDirectory = "c:\temp"
strFile = "\MyDailyLog.csv"
strText = strMood & "," & strWeight & "," & strExercise & "," & strDiet

' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

' OpenTextFile Method needs a Const value
' ForAppending = 8 ForReading = 1, ForWriting = 2
Const ForAppending = 8

Set objTextFile = objFSO.OpenTextFile _
(strDirectory & strFile, ForAppending, True)

' Key Section to write the strText to the file.
' Writes strText every time you run this VBScript
objTextFile.WriteLine(strText)
objTextFile.Close

WScript.Quit

When this .vbs file is launched, first it’ll prompt you for all of the factors you want to track. In this example I used mood, weight, exercise, and diet.

task-schedule12

These answers are stored to variables, and then passed to your output file, which in this example is stored in c:/temp/.

First, create the MyDailyLog.csv there and create the header in the first row. Once you’ve got this file created, it’s ready to start collecting your journal entries!

task-schedule13

Just create a new task (like you did in the first section of this article), and for the task, set it to run the script where you saved the .vbs file.

task-schedule14

Set up the task to run every evening when you’re usually online reading the news or checking your email, and you’ll never forget to track your stats again!

4. Play Music in the Morning

Does your alarm clock do a terrible job of waking you up every day? Do you hit snooze and then just go back to sleep? Well, here’s a solution using Task Scheduler. Just configure it to trigger a song that you know will wake you up.

The command to do this on any Windows PC is: wmplayer “c:\songname.mp3″

Set up your new task to kick off this loud and upbeat song about half an hour before you want to wake up.

task-schedule15

You will notice that you need to give the full path for wmplayer.exe (using the Browse button will make this more convenient). Then, in the Add arguments (optional): field, provide the full path to your music file, in quotes.

And if that music 30 minutes before you want to wake up doesn’t work, set up another task to kick off an even more obnoxious song for 15 minutes before you want to wake up.  Finally, another only 5 minutes before (maybe that one should be a loud, blaring horn!).

Do note: You will need to configure the task to run even if the computer is asleep, and you’ll need to make sure not to turn your computer off at night when you go to bed. If it goes to sleep, it’s fine, but the computer does need to be on for this task to work!

By the way, if you just want to kick off a full playlist of songs 30 minutes before you get up, you can use this command: wmplayer /Playlist PlayListName

5. Play a Video Every Morning

Here’s another approach to waking up, if you’re like me and sound doesn’t cut it for you. Why not hook up your laptop to that big TV in your room and kick off a video in the morning to wake yourself up? This allows you to choose the sights and sounds that you know will get you out of bed.

One way to do this is exactly like the audio scheduled task above, but using the fullscreen option: wmplayer “c:\videoname.wmv” /fullscreen

task-schedule16

In the arguments field, just remember to keep the file name inside the quotes, and the /fullscreen switch outside of them, at the end of the string.

The same rule as the audio applies – set the task to run even when the computer is asleep, or it won’t work – and don’t forget to leave your computer turned on overnight.

6. Take Monthly Backups to the Cloud

I bet you store lots of files on your PC or laptop that you’d absolutely hate to lose. Maybe it’s your collection of saved music files (which you’re constantly adding to), or maybe it’s that big novel you’re working on. Whatever the data is, it’s a very good idea to take frequent backups, just in case something terrible happens to your PC.

Taking backups is one of the best things Scheduled Tasks is suited for, but why save to a local hard drive when you could save your files to the cloud? One clear advantage of this is that if there’s – heaven forbid – a house fire, your information is still safe.

The first step to set this up of course, is to install OneDrive, Google Drive, or any other cloud storage service that lets you install it on your PC as a mapped drive.

task-schedule17

Next, install SyncToy from Microsoft. Then, set up a folder pair between your local folder where your favorite music is stored, or where you’ve got that special novel you’re working on, and the drive in your cloud drive where you want to back up those files on a regular basis.

task-schedule18

On the next screen you’ll choose to either synchronize or contribute. If you sync then changes go in both directions. If you set up contribute, then only new files on your local drive will go to the cloud, but files you delete won’t get deleted from the cloud. Finally, give the folder pair a name.

Now, all you have to do is run this command as a scheduled task: c:\program files\synctoy 2.1\synctoycmd.exe -R “SyncMyMusic”

Here’s what that looks like in the Task Scheduler:

task-schedule19

Put the Program/script: field all in quotes, and for the arguments field you’ll want -R first, and then the folder pair name you created above, placed in quotes.

Set this task to run every day — or whatever frequency makes you feel safe — and you’re all done. Forget about it, you’ll always have a synced copy of your files safe in the cloud!

7. Post to Facebook and Twitter

Sure, FBCMD is dead, but you can still post to Facebook from the command line using Curl. If you haven’t done this yet, I highly recommend following my guide to set up Curl on your PC so you can issue Facebook posts via command line.

Once you’ve got it set up, you can post to Facebook from the command line using: c:\temp\curl\curl -X POST https://maker.ifttt.com/trigger/post_facebook/with/key/<enter-your-key-here>?value1=”This%20is%20your%20post.”

Now think how cool it would be if you didn’t even have to open up Facebook to post – just set up a .vbs script like you did above for journaling, but have it ask you what you want to post, and let your computer do your Facebook posting for you!

Here’s what that .vbs script looks like:

Option Explicit

Dim strYourPost
Dim objResult
Dim objShell

strYourPost = Inputbox( "What do you want to post today?:" )
strYourPost = Replace(strYourPost, " ", "%20")

Set objShell = WScript.CreateObject("WScript.Shell")    
objResult = objShell.Run("c:\temp\curl\curl -X POST https://maker.ifttt.com/trigger/post_facebook/with/key/bMTAzkaD1qIc7NlGErPGOu?value1=" & strYourPOst)

WScript.Quit

Then, simply use Scheduled Task to schedule the script to run when your computer first starts up, or at 8 am every morning when you’re having your coffee.

task-schedule20

And in seconds your post will get posted to Facebook, and you won’t get distracted by all of the cat posts.

task-schedule21

This is a great way to simplify life, while keeping your family and friends updated without letting the social network eat away at your productivity.

By the way, you can do the same exact thing with Twitter, using a program called Twt.

Once you have that application installed, Tweeting from the command prompt is as simple as typing: twt I’m posting this from the command prompt!

There’s no need for a vbs code in this case because you can just schedule a task using “twt” as the command, and your Tweet in the argument field. Simple!

Using the Task Scheduler

As you can see, the Windows Task Scheduler is good for a whole lot more than just scanning your PC or doing local backups. Sending email, accessing the cloud, posting to Facebook and Twitter — these are just the tip of the iceberg.

If you can make it happen in a command line or a Windows script, you can schedule it with the Task Scheduler. All it takes is a bit of creativity and some elbow grease, and you can automate a whole lot more than you ever imagined.

Hopefully the above automations helped you start thinking about things you can schedule in Windows. What other ideas do you have? Have you ever automated anything interesting with the Task Scheduler? Share your thoughts and experiences in the comments section below!

Image Credits:Industrial robot by PP77LSK via Shutterstock