Scheduling a Python script to run at prescribed times

How to schedule a geoprocessing script to run at prescribed times

Scheduled Tasks

Steps:
  1. The method to schedule a script depends on your system.
    • For Windows XP:
      1. Click the Windows Start menu, point to Control Panel, then double-click Scheduled Tasks.
      2. If the control panel is in category view, click Performance and Maintenance and click Scheduled Tasks.
    • For Windows 2000 and NT:
      1. Click the Windows Start menu, point to Settings, point to Control Panel, then click Scheduled Tasks.
    • For Windows Vista:
      1. Click the Windows Start menu, click Settings, point to Control Panel, then click System and Maintenance. Click Administrative Tools and click Schedule tasks.
    • For Windows 7
      1. Click the Windows Start menu, click Control Panel > Administrative Tools and click Task Scheduler.
        NoteNote:

        If Control Panel is in category view, click System and Security, click Administrative Tools, then click Task Scheduler.

  2. Double-click Add Scheduled Task.
  3. Complete the options on the wizard.
    1. When asked to click the program you want Windows to run, click the Browse button and the Python script.

If the program you want to run is a Python script with arguments

For more information about scheduled tasks, see the Windows Help.

Steps:
  1. On the last pane of Schedule Task Wizard, check the Open advanced properties check box.
  2. On the Task Properties dialog box, change Run to contain the Python executable, your script, and the arguments you want the script to run, as shown in the following example.

    c:\python26\python.exe c:\gisWork\myscript.py c:\gisWork\gdb.mdb\counties 10


12/15/2011