Procedimiento de automatización de tareas bajo Windows NT


El proceso consiste en lograr que Windows NT ejecute periódicamente un comando interno, externo o un batch.

Para lograr lo anteriormente descrito lo primero que ha de hacerse es activar el servicio Schedule en el panel de control dentro del icono services.

Nótese que el servicio Schedule esta en modo automático, esto con el fin de que al iniciar Windows NT dicho servicio se active. Por defecto este servicio viene desactivado por lo que hay que dar clic en el botón Startup y definir los siguientes parámetros:

Startup Type: Automatic.
Log On As: System Account
Allow Service to Interact with Desktop

Esta ultima instrucción es fundamental para que el servicio trabaje de forma correcta.

Después de configurar el servicio Schedule lo que procede es invocar el Command Promt y usar el comando "AT". La sintaxis de este comando es la siguiente:

The AT command schedules commands and programs to run on a computer at a specified time and date. The Schedule service must be running to use the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE] /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername Secifies a remote computer. Commands are scheduled on the local computer if this parameter is omitted.
Id Is an identification number assigned to a scheduled command.
/delete Cancels a scheduled command. If id is omitted, all the scheduled commands on the computer are canceled.
/yes Used with cancel all jobs command when no further confirmation is desired.
Time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the user who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the week or month. If date is omitted, the current day of the month is assumed.
/next:date[,...] Runs the specified command on the next occurrence of the day (for example, next Thursday). If date is omitted, the day (for example, next Thursday). If date is omitted, the current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be run.

Ejemplos:

C:\ At 14:30 cls
Ejecuta a las 14:30 el comando cls

C:\ At 10:00 /every: monday c:\prueba.bat
Ejecuta a las 10 de la mañana de cada lunes el archivo "prueba.bat".

C:\At /delete /yes
Borra todas las tareas previamente programadas.

Hay que aclarar que este comando funciona tanto para Windows NT Work Station 4.0 como en Windows NT Server 4.0.

Si se dispone de una unidad de respaldo en cinta se puede usar el comando "Backup" de Windows NT directamente desde el Command Prompt.
Para conocer la línea de comandos de "Backup" solamente debe de escribir desde el Command Prompt: "ntbackup /?".


Este trabajo se ha realizado como un aporte a toda la comunidad por: Rolando Herrera Burgos