Monday, January 20, 2014

Task Scheduler



With Scheduled Tasks, you can schedule any script, program, or document to run at a time that is most convenient for you. Scheduled Tasks starts every time that you start Windows XP and runs in the background, and it starts each task that you schedule at the time that you specify when you create the task.

Using Scheduled Tasks

To schedule a new task:
1.       Open Windows Task Scheduler/Actions list/Create Basic Task…


    
2.       Fill expected information and click "Next" button





3.       Select days in week the Task should be started, after that clicking on “Next” button


 

4.       Fill the executed file path, after that clicking on “Next” button 




For example, with Checker Global – Run all test cases:
  - Program/script: C:\CheckerConsole.exe
  - Add arguments (optional): 1
  - Click Next

For example, with Link Common SLP – Run a specific test case:
  - Program/script: C:\LinkConsole.exe
  - Add arguments (optional): 2 range 571
  - Click Next


5.       Review configuration and click "Finish" button
 


6.       Some useful CLI commands:
   

ü_ Restart Windows: shutdown –r
ü  Delete file: del file_path
ü  Copy file: copy source_file_path des_file_path
ü  Push output to a logging file: command > log_file_name
ü  Push (append) output to a logging file: command >> log_file_name
ü  Print out screen: echo text_value (echo %time%)
ü  Comment out a line: start the line with “REM
ü  Etc…

Note:
ü  In a task scheduler item, we must provide the full file path (if any) in our executing scripts, something like this “Program/script: copy D:\LearnScript\ABC_Script.txt D:\LearnScript\Framework_Script.txt
ü  To start a scheduling task properly, the user who has created and owns that task must be active (has logged in her/his account) in advance. If the machine has rebooted and the user has never signed in before, the task won’t be able to execute.

Using Advanced Options in Scheduled Tasks
 
If you want to change the configuration of the task, click Open in the advanced properties for the task before you click Finish. After you click Finish, the Properties dialog box opens for the task.

On the Schedule tab, you can change any of the scheduling options that you chose in the wizard, and you can also change the task configuration so that the task does not run too long, does not run if the computer is running on batteries (for laptops), and to specify whether or not the computer should be idle for the task to run.

NOTE: You can open the Properties dialog box for the task at any time if you open Scheduled Tasks, right-click the task, and then click Properties.

You cannot schedule a task so that it repeats in an interval less than one day; however, you can do this in the Properties dialog box:
1.     Click the Schedule tab, and then click Advanced.
2.     Click to select the Repeat task check box, and then specify the number of minutes or hours in which you want the task to be repeated.
                                                              

                                                                                                      HoaLe





 












No comments:

Post a Comment