API for NT Command Scheduler?

API for NT Command Scheduler?

Question:
How can I program the NT Command Scheduler (AT command) using VB5? What are the API calls? Right now I’m just using Shell to run AT. Is this my only option?

Answer:
This is a very simple example that should show you what you need to know to use the AT scheduling API:

Private Const JOB_RUN_PERIODICALLY       As Long = &H1&Private Const JOB_RUNS_TODAY             As Long = &H4&Private Const JOB_ADD_CURRENT_DATE       As Long = &H8&Private Const JOB_NONINTERACTIVE         As Long = &H10&Private Type AT_INFO   JobTime                             As Long   DaysOfMonth                         As Long   DaysOfWeek                          As Byte   Flags                               As Byte   Dummy                               As Integer   Command                             As LongEnd TypePrivate Declare Sub NetScheduleJobAdd _   Lib "netapi32.dll" _   (ByRef ServerName As Byte, _    ByVal Buffer As Any, _    ByVal JobID As Long)Public Sub Test(ByVal xi_Time_ms As Long)   Dim p_lngJobID                      As Long   Dim p_bytServerName()               As Byte   Dim p_typAT_Info                    As AT_INFO   Dim p_strCmd                        As String   Dim p_lngPtrToType                  As Long      p_typAT_Info.JobTime = xi_Time_ms ' Milliseconds past midnight   p_typAT_Info.DaysOfWeek = 0&   p_typAT_Info.DaysOfMonth = 0&   p_typAT_Info.Flags = 0&   p_strCmd = "CMD.EXE"   p_typAT_Info.Command = StrPtr(p_strCmd)      p_bytServerName = vbNullChar   p_lngPtrToType = VarPtr(p_typAT_Info)      NetScheduleJobAdd ServerName:=p_bytServerName(0), _                     Buffer:=p_lngPtrToType, _                     JobID:=p_lngJobID                     End Sub

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular