Testing to see if the System Time is between certain hours

Discuss Task Sequences and Scripting related issues.

Postby Tech Support » Fri Oct 26, 2007 3:33 pm

Basically you have to check if $%DATE::hh%$ = 7 or 8.

Use 2 Variable Monitor tasks at the start of the chain..
monitor 1 - If $%DATE::hh%$ > 6 go to monitor2
monitor 2 - If $%DATE::hh%$ < 9 continue with chain, else Go to Step 100 (exit chain)
Tech Support
Site Admin
 
Posts: 1276
Joined: Thu May 25, 2006 11:12 am

Postby melvin » Sat Oct 27, 2007 12:28 pm

use DATE:hh without the $%... %$.
You need to use the following settings

monitor1:
variable name: DATE::hh
variable value: 6
comparison criteria: >
Task to Run = monitor2

monitor2:
variable name: DATE::hh
variable value: 9
comparison criteria: <
Task to Run = YOUR_CHAIN_TASK

This way you can run these two monitor tasks outside the chain. You would have to schedule ONLY the 'monitor1' task.

The other option:
for the 'Task To Run' fields, use NONE for both monitor1 and monitor2 tasks. Then add both monitor1 and monitor2 as the first steps of the chain as robert indicated above.

Oct 27, 2007 1:18:07 PM Variable monitor - test - variable = DATE::hh , value 13
Oct 27, 2007 1:18:07 PM Variable monitor - test - End Instance = 2 , Exit Code = -100 , Runtime (ms) = 47
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california


Return to Task Sequences, Chains and Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron