Scripting Question

Schedule task creation with randomized time

09/30/2015 2210 views


I need to create a schedule task with xml file in randomized time.

I have tried the below cmd lines and it is working fine but I need to change the trigger time to randomize time.

when I deploy this cmd lines to 50 machines the trigger time is set to 10a.m on all machines but I need a random/different time on other machines. so what switches do I need to use for that?

schtasks.exe /create /tn "%XXX%"  /XML "Config.xml" /f

any help should be appreciated.

0 Comments   [ + ] Show comments


All Answers


%RANDOM% generates a random number between 0 and 32767.

See http://ss64.com/nt/syntax-random.html for examples.

Answered 10/02/2015 by: mduiker
Orange Senior Belt

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ