How to run Origin periodically using Windows Task Scheduler

You may wonder how to run the Origin application (data import, analysis, graphing, etc.) periodically, say at a certain time every day, or even only one specific time on a specific day. This blog explains the procedure to set up such task.  Basically, you’ll need to program the sequence of the tasks, and use the Windows “Task Scheduler” to  run a script file  with a specific schedule.

We will use the following example to illustrate:

1) Make a target process
In this sample, we will grab the latest update from an NOAA page and generate a graph and export it as image file to rour desktop. The OriginC code is as below (you can also directly download this file and put the file under your <User Files Folder>\OriginC)

The LabTalk script to call the Origin C function is straight forward:

Save this script to a file, say, ScheduledTask.OGS in your User Files Folder (UFF).

2) Start the Task Scheduler
Run the Window “Task Scheduler“. You can find this tool in the Control Panel:
Control Panel> System and Security> Administrative Tools> Task Scheduler     

3) Create a Basic Task
Select “Create Basic Task…” in the right side panel. You move to the “Create Basic Task” page. Here, enter your task’s name and the description like the screenshot below. Press “Next“. (You move to the “Task Trigger” page.)

4) Set the Type of Schedule
In the “Task Trigger” page, choose the type of event such as Daily, One Time, etc. Press “Next“. (You move to the type specific page like “Daily”.)
5) Set the Date and Time to Run
In the task specific page, set the date/time for the event. In this sample, we set it as 8:00 AM everyday. Press “Next“. (You move to the “Action” page.)

6) Select “Start a Program” as an Action
In the “Action” page, choose “Start a program“, and press “Next“. (You move to the “Start a Program” page.)

7) Set the Origin Program and the LabTalk Script to Run
In the “Start a Program” page, in the “Program/script:” field, enter the command line to call Origin to run the specific LabTalk script file. In our case, we enter:

Here, C:\Program Files\OriginLab\Origin2019\ is the program folder path where Origin is installed. Your path may be different.  To check your path, choose “Help: Open Folder: Program Folder” menu.  Origin96_64.exe is the Origin executable program name. Note that different versions of Origin will have a different names, so you need to update this baed on your installed version.  ScheduledTask.OGS is the name of the LabTalk script file, and main is the script section name to run, which is the first line in the script file, that is “[Main]“.
Press “Next“. (A prompt would appear, and you click Yes. You move to the “Summary” page.)

8) Check and Complete
In the “Summary” page, check your input information, and if correct, press “Finish” button.  Otherwise, you can go back to previous pages by pressing “<Back” button.

Now your task is all set to run as scheduled!

If you want to run the task several times in a day, create multiple tasks.

Related Posts

About S Z

Male, single, alive.

View all posts by S Z →

Leave a Reply
