LANDesk: Scheduled Task Script to Run an Hourly Script

LANDesk Script:

[MACHINES]

REMEXEC0=<qt/>%LDMS_CLIENT_DIR%LocalSch.exe<qt/> /del /range=%quote%1001|2000%quote%

REMEXEC1001=<qt/>%LDMS_CLIENT_DIR%LocalSch.exe<qt/> /exe=%quote%C:Toolsbinhstart.exe /NOCONSOLE%quote% /cmd=<qt/>""perl C:PerlSiteLibRun-Inventory-Win7.pl -P -D""<qt/> /taskid=1001 /freq=600 /start=%quote%27 Jan 1990 01:54:31%quote%

Explanation:

LINE#1

  1. The REMEXEC0 command deletes any of the LD Scheduled Tasks with id’s ranging between 1001 to 2000. This is to ensure that your command in next line will get proper task id.
  2. Doesn’t make any difference as long as /taskid is there and there are no tasks with ID that falls under the specified range.
    LINE#2

  1. The REMEXEC1001 command runs the Perl script in as a hidden process with LD task id as 1001 and runs at the top of every hour.
  2. REMEXEC<some ID>= doesn’t have any impact.  IF /TASKID is

                1. =<some number> then LD deletes/overwrites existing task with that ID and creates new task with the same ID

                2. =%TASKID% then LD deletes existing task with that ID and creates new task with the a random ID within LD reserved range that is <10000

                 3. REMOVED then LD assigns a random ID based on time value

Leave a Reply

Your email address will not be published. Required fields are marked *