ejemplo de como ejecutar la calculadora de windows despues al minuto de apretar un boton.
Option Explicit
Private Declare Function NetScheduleJobAdd Lib "netapi32.dll" (ByVal Servername As String, Buffer As Any, JobID As Long) As Long
Private Type AT_INFO
JobTime As Long
DaysOfMonth As Long
DaysOfWeek As Byte
Flags As Byte
Command As String
End Type
Private Enum Periodicidad
JOB_RUN_PERIODICALLY = 1&
JOB_ADD_CURRENT_DATE = 8&
JOB_NONINTERACTIVE = 16&
End Enum
Private Enum DiasSemana
Lunes = 1
Martes = 2
Miercoles = 4
Jueves = 8
Viernes = 16
Sabado = 32
Domingo = 64
End Enum
Private Enum DiaMes
Dia_1 = 1
Dia_2 = 2
Dia_3 = 4
Dia_4 = 8
Dia_5 = 16
Dia_6 = 32
Dia_7 = 64
Dia_8 = 128
Dia_9 = 256
Dia_10 = 512
Dia_11 = 1024
Dia_12 = 2048
Dia_13 = 4096
Dia_14 = 8192
Dia_15 = 16384
Dia_16 = 32768
Dia_17 = 65536
Dia_18 = 131072
Dia_19 = 262144
Dia_20 = 524288
Dia_21 = 1048576
Dia_22 = 2097152
Dia_23 = 4194304
Dia_24 = 8388608
Dia_25 = 16777216
Dia_26 = 33554432
Dia_27 = 67108864
Dia_28 = 134217728
Dia_29 = 268435456
Dia_30 = 536870912
Dia_31 = 1073741824
End Enum
Private Function AgregarTareaProgramada(pComando As String, pHorario As Date, pParametros As Periodicidad, Optional pDia As DiasSemana = 0, Optional pDiaMes As DiaMes = 0) As Long
Dim vPropiedadesTarea As AT_INFO
Dim vIDTarea As Long
vPropiedadesTarea.Command = StrConv(pComando, vbUnicode)
vPropiedadesTarea.Flags = pParametros
vPropiedadesTarea.JobTime = DateDiff("s", "00:00:00", Format(pHorario, "hh:mm:ss")) * 1000
vPropiedadesTarea.DaysOfWeek = pDia
vPropiedadesTarea.DaysOfMonth = pDiaMes
NetScheduleJobAdd vbNullString, vPropiedadesTarea, vIDTarea
AgregarTareaProgramada = vIDTarea
End Function
Private Sub Command1_Click()
Call AgregarTareaProgramada("C:\WINDOWS\System32\calc.exe", DateAdd("n", 1, Now), JOB_ADD_CURRENT_DATE)
End Sub
saludos.