Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




VB With Task Scheduler


I have been told that Mathew Gates or Megatron PM are good in that:

how can i use task scheduler with VB?
i want the user inside my application to have the choice to run the program himself each day, or to CHECK AN OPTION INSIDE THE PROGRAM (but how to program it???) that lets the scheduler run the program the next day for example, without any intervention
thanks
terry




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Using Visual Basic To Schedule A Task In Task Scheduler Running Windows 98.
Need to use Visual Basic to schedule a task in Task Scheduler running Windows 98.

Are there API calls to make?

AT commands that work?

Some way to programmatically schedule Task Scheduler on Windows 98?

Windows Task Scheduler - Add A Task
Does any body have any idea how to add a task to the windows task scheduler (if its not there already) through a vb program ?

So that a program can be run through the task scheduler...
(By the way, I know how to do it manually, I just want to put a task to the scheduler through a vb program)

Thanks
Ram

Task Scheduler.
Hello.

I found in the following location:
http://www.etasoft.com/schtask/vbcode.htm

an article that talks about creating new scheduled tasks.
It is mentioned there that i should reference a dll called "SchedTask 1.0 Type Library" but i can find it. Where should i look it in? Or how else can i interact with windows task scheduler?

Thanks, Tal.

IE 5.0 TASK SCHEDULER
Has anyone come across VB code to add jobs to "Task Scheduler" through the api. I've only seen C++ code. I know I can use AT commands but they do not support the full set of features in TASK SCHEDULER.
Thanks.

Task Scheduler
Hello everybody.

Can anyone tell me how to use windows task scheduler from VB.

Task Scheduler
I would like to upload files to an ftp site hourly. The app to do this should be run hourly and ended when upload is completed. The problem is creating a scheduled task to run this app. Manual configuration is not an option. Thanks for any ideas

Task Scheduler
I am running a scheduled task (Task Scheduler on win 2k) on a remote server. Is there any class library to access the properties and methods of this "Task Scheduler". I really appreciate your help

Task Scheduler
http://www.vbforums.com/showthread.php?postid=1273788

Task Scheduler
Background:
I'm in the process of developing a task scheduler at work. This application runs on a dedicated workstation. It simply displays the time, incrementing every second. Every second it is also checking an ini file to see if it should call another application or run a backup.

Example:
At 6:00 every day run BlockedReport.exe
At 17:30 every day backup TestDatabase.mdb

I want to make this so it takes up the least amount of system resources. The algorithm I'm thinking of using is this:

First off check to see if seconds = 00. This will ensure that the function is only ran once a minute instead of 60 times a minute.
If it is = 00, then check to see if the task should be run on this day.
If it should be run, then check to see if it should be run at this time.

Here is some sample code (I know that it isn't exactly what I said above yet):

VB Code:
Private Sub tmr_TimerFired() Dim x As Integer, iCount As IntegerDim results() As String   lblTime.Caption = Format(Time, "h:mm:ss")    Call ini.GetSections(INIFile, results())  iCount = UBound(results()) + 1    For x = 1 To iCount      If Format(ini.GetSettingINI(INIFile, "Task" & x, "Time"), "h:mm:ss") = Format(Time, "h:mm:ss") Then            Select Case ini.GetSettingINI(INIFile, "Task" & x, "Status")              Case 1          'Status 1 = Execute File          If ini.GetSettingINI(INIFile, "Task" & x, "Params", "None") = "None" Then            hyp.File Me.hwnd, ini.GetSettingINI(INIFile, "Task" & x, "Path")          Else            hyp.File Me.hwnd, ini.GetSettingINI(INIFile, "Task" & x, "Path"), ini.GetSettingINI(INIFile, "Task" & x, "Params")          End If                Case 2          'Status 2 = Backup File          Call Backup(x)              Case 3          'Status 3 = Backup and Compact DB          Call Backup(x)          Call CompactDatabase(x)                  End Select          End If    Next x    If Format(Time, "n") Mod 15 = 0 Then    If y = 0 Then Call WriteMem    y = 1  Else    y = 0  End If  End Sub


Does anyone have any suggestions, comments, critisims, ideas on how I could do this better?? If you need any more information, just ask. Any help is appreciated.

Thanks,

Mike

Run Vb Pgm Using Task Scheduler
I have a vb program with no forms. It runs from the command line with single argument. It will not run when scheduled. What do I need to do?

Task Scheduler
I have posted this question before but I did not get any response.

I have a server that has several jobs scheduled. I was wanting to mak a app that I could go in and loop through the jobs and disable all or selected tasks. Anyone know how to manipulate the task scheduler?

Thanks
LJ

Task Scheduler Win98
For video capture and sound recording I have written a VB6 program. This program consists actually two programs, 1- TimerSetCap, 2 – TimerCaption. In the TimerSetCap I can select Video or Sound recording/capture and I give the duration of the recording. These values are stored in a data file. From the TimerSetCap prog I start the Win98 Task Scheduler and make the settings for the starting time. At this moment I can switch my computer in Standby modus.
At the given time the Task Scheduler starts the computer and the second program, the TimerCaption which reads the data from the data file and the caption starts for the given time. So far OK.
I like to combine the Task Scheduler in my TimerSetCap program, so I can set all values in one Form.
Questions:
A – Is there a possibility to reach the data of the Task Scheduler and change them. Windows Explorer do not find the *.job (TimerCaption.job) file.
B – Is there an API available which can change Text in a TextBox (Class Name: SysDateTimePick32) of a program which is called with the VB Shell function.

Opening Task Scheduler
Is there a way of opening the windows task scheduler properties window (passing in a current task) ???

Task Scheduler In Windows NT
Hello

I am attempting to amend a task created within windows NT
I know the task is running every 5 mins as I can see that in the error log
Problem is is that I cannot find the task
It just simply isn't showing when I go into task scheduler via my computer
Am I looking in the wrong place or doing anything obviously wrong

Thanks

Damian.

Running VB6 App From MS Task Scheduler
I can't run any VB6 app using the MS Task scheduler.

Anyone know of issues doing this?

Helmar B. Herman, VP ProtoProducts

Task Scheduler Win98
For video capture and sound recording I have written a VB6 program. This program consists actually two programs, 1- TimerSetCap, 2 – TimerCaption. In the TimerSetCap I can select Video or Sound recording/capture and I give the duration of the recording. These values are stored in a data file. From the TimerSetCap prog I start the Win98 Task Scheduler and make the settings for the starting time. At this moment I can switch my computer in Standby modus.
At the given time the Task Scheduler starts the computer and the second program, the TimerCaption which reads the data from the data file and the caption starts for the given time. So far OK.
I like to combine the Task Scheduler in my TimerSetCap program, so I can set all values in one Form.
Questions:
A – Is there a possibility to reach the data of the Task Scheduler and change them. Windows Explorer do not find the *.job (TimerCaption.job) file.
B – Is there an API available which can change Text in a TextBox (Class Name: SysDateTimePick32) of a program which is called with the VB Shell function.

Windows Task Scheduler
How do I open a the windows task scheduler with VB6? I've tried using the "shell" command but apparently the task scheduler is not listed as an executable file. I'm running a Win2K OS.
Help....

How Can You Create A Task Scheduler?
Lets say i want something to run or do something every X minutes.. how can i do that?

Windows Task Scheduler?
Is there any way to control this, i.e. read task
info and create new tasks, via VB?
Thanks, DaveBo

Mail And Task Scheduler
I have a program that is launched by Scheduler on an NT4 server (with Outlook 2000). Outlook only uses one profile and scheduler is set to logon with the UserId that owns that exchange account. The problem is that whenever the program is launched via the scheduler it gives the following error:

"MAPI Failure: valid session ID does not exist"

However, if I run the program while physically logged onto the box it works great.

The logon code that I am using is:

Private Function LogOn() As Boolean

Dim Result As String
Dim HFile As Long

If MapSess.NewSession Then
LogOn = False
Exit Function
End If

On Error GoTo errLogInFail

With MapSess
' Set DownLoadMail to False to prevent immediate download.
.DownLoadMail = False
.UserName = "MS Exchange Settings"
.LogonUI = True ' Use the underlying email system's logon UI.
.SignOn ' Signon method.
' If successful, return True
LogOn = True
' Set NewSession to True and set0
' variable flag to true
.NewSession = True
bNewSession = .NewSession
MapMess.SessionID = .SessionID ' You must set this before continuing.
End With
Exit Function

errLogInFail:
HFile = FreeFile
Open "C:error.log" For Append Access Write Shared As HFile
Write #HFile, Error
Close HFile
Err = 0
Resume Next

End Function


If anyone has any suggestions it would be greatly appreciated. I need to get this thing working and am getting frustrated!

Thanks!

Windows Scheduler Task
Hi all

Can any one help me out. I have a problem while creating the scheduler task.

I can not able to create a task for monthly, But i wanted to create a

schedule task for selected months (eg., Jan, Mar, Jun,Sep).

I am using this API's

Private Declare Function NetScheduleJobAdd Lib "netapi32" (Servername As

Byte, PointerToBuffer As AT_INFO, JobInfo As Long) As Long

AddJob "jai2000", 60000000, 5, 0, 1, "c:abc.bat"

Parameters : (servername,time,day of month, day of week,flag,command)

In day of month, if i give a value it will be considering as day (eg. 2nd of

every months)

But my requirement is (eg. 2nd of Jan,Mar,Sep)

Please let me know if it is possible. It is a very very very urgent

requirement...

Advance thanks.

Regards

Windows Scheduler Task
can i run a vb 6.0 exe that i create , the program basically reads text files and creates new files
as a task in windows scheduler ?

thanks for your help

Task Scheduler Problems
Hello,

I am tring to schedual a vb script with at.exe command but the task is not executed. I did not see any errors in the SchedLgU.txt file (the log file). Any ideas?

Thanks!

How To Add Prog. In Task Scheduler?????
I want my prog. to mail at some predefined schedule... so i want my vb prog. to add itself to task scheduler (at time of installation of prog.) ..... plz help me........

Exposing Task Scheduler API
Hi Folks,

I'm already declaring NetScheduleJobAdd Lib "netapi32.dll" on my application so I can schedule an ActiveX.exe component for later execution. However, I'm finding that the Task Scheduler cannot run the task because the username and password is missing from the job (Win2000 and VB6). I don't see a way to set uname and passwd from the netapi32 library. Is there some other library with the the function I need that can be referenced by VB6? Or I am I going to have to do something with Sleep or Timer?

Thanks,

Troy

Windows Task Scheduler & VB
How to invoke the Functionalities of the Windows Task Scheduler from VB using Windows API

Windows Task Scheduler
Hi everyone,
I am using a VC dll to invoke windows task scheduler. the dll works fine. But when using it on NT/2K OS, we need to set username and passwords for the task to work in the desired manner, for this i used Itask:setaccountinformation method for class itask. Now the dll seems to run fine but i am unable to set username and password still.
Please guide me in this regard
thanx
Tushar M Jain

Scheduling A Non-interactive With NT Task Scheduler
Hi,
I've been using the following code to schedule tasks with the NT scheduler. I've noticed that the function in this code only schedules interactive tasks and I want to schedule non-interactive tasks. I notice the Const "JOB_NONINTERACTIVE = &H10" and wonder if this has anything to do with how the task is scheduled. Can anyone help?
Thanks very much

the code is at :-
http://www.vbusers.com/code/codeget....1&NumReplies=0

Methods And Procedures Of Win Task Scheduler
Hi,

Is there a way to access the methods and properties of the windows task scheduler?

here's what I want to do in case there is another way of doing this:

I want to add a scheduled task programaticaly but I want that task to be run under a profile. meanning I dont want it to be a System process.

I you go through the ADD SCHEDULED TASK wizard, you will probably see what I mean.

thanks

How To Use Windows Task Scheduler From VB Program
Hi All,
I want to fire the Task SCheduler of windows 98/NT from my Vb application,so that scheduler will be able to run a particular task at a particular time automatically.All of the programs and their run time will be in the listview control at front end,when i will click one button(suppose finish) all the tasks and their run time should automatically updated into the task scheduler and task scheduler will run those at the specified time.Task scheduler will be run at background,its wizard won't be visible to the user.
I tried it with AT command but in AT command we can't specify a particular date such as 12/08/02 ,only thing we can give is weekdays(M to Su)or days of the month(1 to 31).Now i am thinking to do it with API but i couldn't find any API so if u know please help.Is there any other method to do this,then let me know. it is very urgent
many many thanks in advance
arvind

Integrating Task Scheduler With My VB Program
I have been told that Mathew Gates or Megatron PM are good in that:

how can i use task scheduler with VB?
i want the user inside my application to have the choice to run the program himself each day, or to CHECK AN OPTION INSIDE THE PROGRAM (but how to program it???) that lets the scheduler run the program the next day for example, without any intervention
thanks
terry

Add Application To Windows Task Scheduler From VB6
We have developed an application in VB6 (say AA.exe). We wish to
schedule the execution of this application (AA.exe) through Windows
Task Scheduler.

Is there a way through which we can add this application (AA.exe) to
Task Scheduler by using another application (say BB.exe), which is
also developed using VB6? The operating systems can be Windows 2000,
Windows XP or any later version of Windows...

We also wish that whenever the second application (BB.exe) would run
it should always check the scheduling of first application (AA.exe) in
Task Scheduler and if it finds that someone has disabled its (AA.exe)
execution or removed it, then it should be added to Task Scheduler
again.

A reference to any sample available in VB6 will be highly appreciated.

Thanks & Regards

Faiz

What Is The Difference Task Scheduler And NT Service
hi all,
i am intending to write a program that will schedule to send a email like say 9.00am every morning. The program will run at the backend. so i am confusing whether should use Task Scheduler or NT Service , what is the difference between these two?


 

Urgent!!!!! Placed In Task Scheduler But Not Running As Expected!
Hi everyone,

I've placed my working application in the Windows Task Scheduler to run it at a certain time interval. Though my application executes at the assigned time, its status on the Task Scheduler is always displayed as "Running", it seems to me that the program is running non-stop. However, everything works well when I manually execute the application, it runs correctly and unloads within a minute.

Can anyone tell me why is this so? How am I able to resolve it? Besides placing in the Task Scheduler, is there other ways that I can run my program automatically at any particular time?

Thank you very much.

Internet Transfer Control && Task Scheduler
Hi,

My program VB script with an Internet Transfer Control
is working ok in the foreground but when I'm using
the task scheduler (WINDOWS 2000 and NT4.0) I'm
getting "Can't connect to remote host". Even when
I'm using the /interactive option at the AT command

Please, Please help me

Ton Gelissen

Is The Windows Task Scheduler An ActiveX Control And If So How Can I
instantiate it? Sorry if this is an ignorant question.

Thanks



Error 70 Using ActiveX Server With Task Scheduler
This is long winded so bear with...

I am using task scheduler to run an app that makes calls to an ActiveX server. The activeX server opens a connection to a SQL DB, then reads data into a recordset from one of the tables of the DB. At the point that I touch one of the items of the recordset the server pops with ERROR 70.

Worth noting: I can run this app from the desktop and no errors occur.
The DB login uses SQL authentication.

Any ideas?

WinAT Mentions that: AT jobs will NOT run under the security context of the user requesting it. Rather, they will run in whatever context the Schedule service is running, typically the operating system's context.
Which begs the question: What is the OS's security context? and is this related to my problem?

Drive Mapping In WinServer 2003 Task Scheduler
Ok... I have a VB6 utility that uses a lot of FSO objects and freeware Zip/UnZip DLLs.

Because the mapped drive is pointed to a folder, there are all sorts of issues with folders, especially inside the Zips!

What this thing does is read file data (working storage), converts it to a corporate standard, zips it, and uploads it to a SQL Server 2000 dbms.

I have server side batch processes and workstation side realtime processes.

My file structure is:

P:MainData<serialnumber>Test <Date> <Time>Test Files

Now, because P: is mapped to D:Apps, the zips are getting <server>AppsMainData<serialnumber>Test Data <Date> <Time>Test Files... this wrecks havoc when I have to restore things to the mapped P:.

Well... from what I can figure, SQL Server Agent won't look at mapped drives, and neither will Task Scheduler.

Am I correct in this assessment?

Changing the map from P: = D:Apps to P: = D: is out of the question, there are multiple apps out there that use P: = D:Apps. I have suggested the use of a second mapped drive so that my applications can use them, and that might be the easiest fix.

I am looking at PKWare's Software Kit, which has DLLs for Zip/Unzip. Do you all think that using the command line version in a shell would be more reliable?

What is happening is thus:

When I run these jobs from my computer against the mapped P:, all is fine.

When I run these jobs on the server against the mapped P:, all is fine.

When I run these jobs from Task Scheduler with the mapped P:, all hell breaks loose!


Thanks in advance!

How To Create A Job In Task Scheduler With Specific Interval (repeat Time)?
Hi,

How to create a job in task scheduler with specific interval (repeat time)?

Upon visiting numerous sites I could manage to create a task for required time.
But to set the interval of repeat?

My script goes like this:
Const MON = 1
Const TUE = 2
Const WED = 4
Const THU = 8
Const FRI = 16
Const SAT = 32
Const SUN = 64


strComputer = "."
strCommand = "c:TestLog.exe"
strstartTime = "********233000.000000-000"
boolRepeat = True
intWeekDay = MON Or TUE Or WED Or THU Or FRI Or SAT Or SUN
intMonthDay = ""
boolInteract = True

Set objWMI = GetObject("winmgmts:\" & strComputer & "")
Set objNewTask = objWMI.Get("Win32_ScheduledJob")
intRC = objNewTask.Create(strCommand, _
strstartTime, _
boolRepeat, _
intWeekDay, _
intMonthDay, _
boolInteract, _
intJobID)


Now I want this task to execute every 30 minutes upto 11 PM.

How to do it?

Please help. Any sort of help is appreciated.


Thanks
-Srinivas

How To Create A Job In Task Scheduler With Specific Interval (repeat Time)?
Hi,

How to create a job in task scheduler with specific interval (repeat time)?

Upon visiting numerous sites I could manage to create a task for required time.
But to set the interval of repeat?

My script goes like this:
Const MON = 1
Const TUE = 2
Const WED = 4
Const THU = 8
Const FRI = 16
Const SAT = 32
Const SUN = 64


strComputer = "."
strCommand = "c:TestLog.exe"
strstartTime = "********233000.000000-000"
boolRepeat = True
intWeekDay = MON Or TUE Or WED Or THU Or FRI Or SAT Or SUN
intMonthDay = ""
boolInteract = True

Set objWMI = GetObject("winmgmts:\" & strComputer & "")
Set objNewTask = objWMI.Get("Win32_ScheduledJob")
intRC = objNewTask.Create(strCommand, _
strstartTime, _
boolRepeat, _
intWeekDay, _
intMonthDay, _
boolInteract, _
intJobID)


Now I want this task to execute every 30 minutes upto 11 PM.

How to do it?

Please help. Any sort of help is appreciated.


Thanks
-Srinivas

How To Block User To End Task Our Program From Windows Task Manager....??
How to block user to End Task our program from Windows Task Manager....??

or other way is make the program disappear from the Windows Task Manager.........

How Do I Hide My App From The "Task Bar"? (that&#039;s Task Bar Not The Task List) Thanks
I just need some insight on how to make my program not show in the Window's Task Bar.


I appreciate any help, thanks,
Daniel Christie

Can The End Task Like Task Manager Does Be Implemented Using Vb RESOLVED
Can the end task (like task manager does) be implemented using vb

Equivalent To End Task Button In Task Manager?
The title says it all. What API is equivalent to End Task button in Task Manager?

Hiding A Task From Task Manager
How do I do that?

Thanx, Tadej

Please HELP!!! Add Task To Windows Task Schedular
I have a application written in VB 6.0.
I want to add my application to the Windows Task Schedular in prgramatically.
So everytime, if the PC is turned on, the application execute, for example 10:00AM every morning. So within the code I 'm going to specify to add my application to the Windows Task Schedular to execute every morning 10:00AM, if the PC is turned on.
I'm greatly appreciate if anyone can give me an idea how to do this. I really appreciate.

Cheers

Raj

Anyone Know How To Setup A New Task In The Task Manager
Trying to install my exe, and then set it up as Scheduled Task.

Valid Solution is worth a 100% vote!

Scheduler
I want to make a program where you enter a list of peoples names and what days/ hours they want to work for a 2 day event. Then it will fill them into different posts which require a minimum amoun of people. So it will fill all the minimum requirements then go on to fill to palces that could use more. DOes that make sense? Would be this be extremely hard to do? Im not very experienced and wonder if this is over my head. I'm willing to do the work so if you guys got any pointers / ideas about how I might go about it, I would appriciate it.

Scheduler??!!!
yes, does any1 know how to make a scheduling program where you basicly make appointments and manage them (soemthing for a secratary or nurse in walkin clinic or something)....or does any1 have any examples/ source code?? ...please help!

Thank you.

Copyright © 2005-08 www.BigResource.com, All rights reserved