Como se mencionó anteriormente, una tarea programada es lo que está buscando. Para ejecutar un script como servicio, lea esto:
Q4. ¿Cómo puedo ejecutar mi script como un servicio? Esta es también una pregunta con respuestas múltiples, y ninguna de ellas es la única forma de hacerlo. La primera pregunta que debes hacerte es si deseas o no instalar el servicio en otras computadoras además del tuyo.
A1. If you only wish to install the service on your own computer, The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.
A2. If you wish to make the service available to anyone running your script, you can use SRVANY.EXE and ServiceControl.au3. You can then use this code to install your script as a service:
#include "ServiceControl.au3"
$servicename = "MyServiceName"
_CreateService("", $servicename, "My AutoIt Script", "C:\Path_to_srvany.exe", "LocalSystem", "", 0x110)
RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\" & $servicename & "\Parameters", "Application", "REG_SZ", @ScriptFullPath)
or use the following code to delete this service:
#include "ServiceControl.au3"
$servicename = "MyServiceName"
_DeleteService("", $servicename)
Hay una advertencia a la creación de AutoIt como un servicio. Si el servicio no se instala utilizando el código anterior, debe tener la opción "permitir que el servicio interactúe con el escritorio" o, de lo contrario, las funciones de automatización como Control * o Win * no funcionarán. Para asegurar el servicio tiene, de hecho este ajuste, utilice el siguiente código: RegWrite ("HKLM \ SYSTEM \ CurrentControlSet \ Services [ServiceName]", "tipo", "REG_DWORD", 0x110)
tomada de la Tema de preguntas frecuentes en los foros de AutoIt. www.autoitscript.com/forum/index.php?showtopic=37289)