|
|
Comments and Discussions
|
|
 |

|
i want to read the previous one month history of job in asp.net
|
|
|
|

|
Hi. Great code. Thanks. Quick question: I'm gathering information on scheduled tasks on a remote server and displaying some info for our IT department in a centralized console. When IO try to get the tasks from the remote machine, I'm only getting the ones where the author is "SYSTEM". Have you seen this before? Is there a way I can get them all?
Thanks.
Private Sub schdTaskTest()
Dim sched As New Scheduler("millerapps")
Me.winGrid.Rows.Clear()
Dim i As Integer = 0
Dim t As Task
For Each t In sched.Tasks
Me.winGrid.Rows.Add()
Me.winGrid(0, i).Value = t.Name
Me.winGrid(1, i).Value = t.ApplicationName
Me.winGrid(2, i).Value = t.MostRecentRunTime
Me.winGrid(3, i).Value = t.NextRunTime
Me.winGrid(4, i).Value = t.Status
i += 1
Next
End Sub
Thanks.
-John Standley
|
|
|
|
|
|

|
Regardless of the managed wrapper, I tried creating a task using the COM interface without a wrapper in C++, the return code is always E_INVALIDARG as long as the task name is something like “a.a” or “a.aa” or “a.aaa”, it only works when there are at least 4 characters after the dot.
in your sample code, change "Testing" to something like "a.bcd", then it throws exception, do you know why?
|
|
|
|

|
Hi,
I am using your new Task Scheduler Library at codeplex. I am posting here because of an existing account
While playing with my code traversing the registered tasks to find one all went fine. But when I run the code within the local system account (windows service), I get an error, that I have not provided user and password.
What must I do to get this working?
IList<ExecAction> getRelevantActions(Task t)
{
IList<ExecAction> actionList = new List<ExecAction>();
foreach (Action a in t.Definition.Actions) {
if (a is ExecAction)
{
ExecAction ea = a as ExecAction;
if (ea.Path.ToLower().Contains("robocopy.bat"))
{
actionList.Add(ea);
}
}
}
return actionList;
}
IDictionary<string, Task> getRoboCopyTasks()
{
TaskService taskService = new TaskService();
IDictionary<string, Task> tList = new Dictionary<string, Task>();
taskService.UserName = "SYSTEM";
taskList.Clear();
fillTasksFromSubFolder(taskService.GetFolder("\\"));
foreach (Task t in taskList)
{
tList.Add(t.Name, t);
}
return tList;
}
Thank you, Lothar
|
|
|
|

|
Is this TaskScheduler available in c++ language.
|
|
|
|

|
HI
CONGRATUILATIONS FOR YOR TOOL. ITS VERY USEFULL
I have in mind a little tool that need of windows task management
May I use your taskSchedule.dll for do it?
|
|
|
|

|
When using enum MonthsOfTheYear parameter in MonthlyTrigger we can combine them using the bitwise or(|). But in my code I won't know which months of the year will be included in the schedule until runtime. What is the best way to dynamically build this parameter?
|
|
|
|

|
The TaskScheduler component is a great one: it is easy to use and work perfectly. But on W2K8 Server (x64) something is broken, either the component of the actual Task Scheduler.
The problem is the following: any task I define always marked in the Windows Task Scheduler interface as Disabled. Even if I set the status specifically to Enabled, it remains disabled. At the same time, when I open the task and get its properties, its status is according to my setting. When I change the status in the Windows Task Scheduler interface, I get the correct value.
The same occurs in the Comment field: I set a value, Windows doesn't display it. When I open the task I get the value I setup. I can change the value, receive it back when I open the task, but the Windows interface doesn't display any value. If I change the comment in the Windows interface, it is displayed and also returned, and again I cannot change it (at least it is not displayed, but returned).
As my values are returned, it seems the values are saved somewhere. But it is not displayed and even not used (when Windows displays "Disabled", the job is not executed, so it considers the job to be disabled).
Does anyone noticed this strange behaviour?
Can someone drop an ingenious idea how to resolve it (or maybe it is a known W2K8 bug)?
Thanks!
|
|
|
|
|

|
Hi Dave,
I am looking through your code, and can't find anything that seems to enable the option to start a task as soon as possible after a missed schedule.
Is there a way to pass this as a parameter or something when using your library to create Tasks in the scheduler?
Thanks,
George
|
|
|
|

|
Hello,
just for information, another way to get the source of an interop to customize them, is simply tu use the tool reflector to decompile the interop generated by visualstudio
|
|
|
|

|
In the code, I saw: stream.GetBuffer()
This does not cause any errors, but the GetBuffer returns more bytes than those really required, as the MemoryStream pre-allocates more bytes to avoid to many reallocations during use.
stream.ToArray() creates a copy of the buffer, but without those "extra" bytes.
|
|
|
|

|
Has someone a code example in VB.Net?
Perhaps a Demo Project?
|
|
|
|

|
Hi,
AS u mentioned, i tried the following code to schedule a task.
int[] days = { 1, 8, 15, 22, 29 };
t.Triggers.Add(new MonthlyTrigger(9, 0, days, MonthsOfTheYear.July));
The pbm is, I dont see any other task scheduling date except 1st of July. ie, task is scheduled only on 1st of july.
How to schedule a task in multiple days per month?
Thanks!
- Pops
|
|
|
|

|
how would I go about figuring out if a task exists
If Task("My Task").Exists Then
'Do something
Else
'Do something else
End If
|
|
|
|

|
Hello,
Thanks for the good work you have done. Has saved me lot of coding.
I am facing some problem with the status value that i am getting for the task.
In Windows task scheduler the status showed MISSED. But when displaying the value of status column using library it shows NEVER RUN.
Please do reply.
Samir Henry Mackwan
shmackwan@hotmail.com
|
|
|
|

|
Thanks for your codes. But I met a problem in my work. I needed to run an app which referenced your class in an 64-bits machine. But it throwed Exception."System can not find files specials :Exception from HRESULT:0x800700002". It's ok in 32-bits machine.So I want to know how can I do in order to make it run normally in 64-bits machines? Thank you!!!
Looking for you reply!!
|
|
|
|

|
What is the maximum number of task that can exist in the Scheduler? Is there a breaking point. If so should multiple schedulers be used on different machines?
|
|
|
|

|
Hello,
I am trying to schedule a daily repetitive task and have the following code. The task and daily schedule are created but not the repetition, am I missing something???
Thanks for the help.
Dim oTask As Task
Dim oScheduledTask As New TaskScheduler.ScheduledTasks
Dim oTrigger As TaskScheduler.Trigger
oTrigger = New TaskScheduler.DailyTrigger(iHour, iMinute)
oTrigger.DurationMinutes = 24 * 60
oTrigger.IntervalMinutes = 5
oTask = oScheduledTask.CreateTask(sTaskName)
oTask.Comment = sDescription
oTask.SetAccountInformation("", Nothing)
oTask.ApplicationName = sAppName
oTask.WorkingDirectory = sAppPath
oTask.Creator = sCreator
oTask.Triggers.Add(oTrigger)
oTask.Save()
|
|
|
|

|
Hi
How can I retreive a exitcode for a particualar task such as 0x0
can your project retreive exitcodes if so how please provide examples
|
|
|
|

|
I don't seem to be able to get around this issue -- I can't make TaskScheduler create tasks that are to run under the local system account (NT Authority\System on 2003). I am logged in as Administrator.
C:\>CreateMspKaseyaUpdateScheduledTask.exe c:\kaseya\webpages\kaseyacwwebservice
Unhandled Exception: System.UnauthorizedAccessException: Access is denied. (Exce
ption from HRESULT: 0x80070005 (E_ACCESSDENIED))
at System.Runtime.InteropServices.UCOMIPersistFile.Save(String pszFileName, B
oolean fRemember)
at TaskScheduler.Task.Save()
at CreateMspKaseyaUpdateScheduledTask.Class1.saveAndCloseTask(Task task)
at CreateMspKaseyaUpdateScheduledTask.Class1.Main(String[] args)
C:\>whoami
kaseya1\administrator
C:\>
when trying null for system password
C:\>CreateMspKaseyaUpdateScheduledTask.exe c:\kaseya\webpages\kaseyacwwebservice
Unhandled Exception: System.Runtime.InteropServices.COMException (0x80041314): T
he task has been configured with an unsupported combination of account settings
and run time options. (Exception from HRESULT: 0x80041314)
at System.Runtime.InteropServices.UCOMIPersistFile.Save(String pszFileName, B
oolean fRemember)
at TaskScheduler.Task.Save()
at CreateMspKaseyaUpdateScheduledTask.Class1.saveAndCloseTask(Task task)
at CreateMspKaseyaUpdateScheduledTask.Class1.Main(String[] args)
C:\>
I am not sure what I am doing wrong.
Setting
task.Flags = TaskFlags.RunOnlyIfLoggedOn;
and
task.SetAccountInformation("nt authority\\system", null);
Seemingly does the trick, but the task will not run. Doesn't even make an attempt to. I was logged in as a local administrator for each of these runs.
Could you please provide an example with the correct usage to make Task Scheduler create a task that will run under the local system account?
|
|
|
|

|
Urgent!!!I followed u r coding i want to open an .aspx page
example:
http:\localhost\1042\Website1\Default.aspx
i can open any application with ur coding but not a .aspx path .pls tell me.
Nisha
|
|
|
|

|
This is exactly what i was looking for, once again thank you
|
|
|
|

|
Hello,
I would like to find whether this library's license code permits us to use it in a commercial application. I could not find a reference to the licensing anywhere.
Thank you!
|
|
|
|

|
I find this library very useful and try to use it in a window form by refering to the code in the console demo.
i get this error message whenever i run it from a windows form button. it manage to create the task though.
An unhandled exception of type "System.NullreferenceException" occured in System.Windows.Forms.dll
Additional information-object reference not set to an instance of object.
From the error message its coming from the windows form but i couldnt think of any where the message come from. i just created a button and try to run from there.
|
|
|
|

|
When I call the library to list all name of scheduled tasks on Windows XP it work without any problem.
But when I try to do the same on Windows 2000 Server, I always get error message of "Access Deny"
Any solution?
|
|
|
|

|
hello and hye everyone...
I wanna ask for help is someone out there can tell me why we need the TaskSchedulerInterop class.
Thanks in advance...
|
|
|
|

|
hi guys,
My Question is can i invoke my web application through windows service at perticular time of the day. if yes then plz explain me How ? b'coz i've seen the invokation of .exe only by the windows service. so if u have any solution plz reply me.
Thanking u,
ATUL.
|
|
|
|

|
Hi,
What a wonderful site with a discussion board !! Need your expertise.
I don't know how to create a synchronize.job. Is there any existing sample or related topics posted on website ?? ASAP.
Joann
|
|
|
|

|
I need to set scheduling task for every X minutes
Is there available trigger on this library?
Chaa
|
|
|
|

|
Its really very useful. But i have a question. After addding a number tasks to Scheduled Tasks, is there any way to monitor these added tasks using .net Windows Service? can somebody please clarify me on this? Thanks
|
|
|
|

|
hi ...... Its really great work. I used this libarary & Scheduled the tasks as per my required trigger. It work fantasitically. I tried to scheduled the task to run TestApp.exe, and it scheduled that task & ran properly.
it Really helped a lot.
But my problem with this program is that we need to give the Application path in case sensitive manner. Can we able to remove this restriction?
Thanx for a Library
|
|
|
|

|
Hello
Just some help for the options, please:
I must change the days according to the options of my software (in an INI file).
This software transfers accountancy datas some nigths the user has choosed
I use the weekly trigger: taskname.Triggers.Add(New WeeklyTrigger(8, 0, DaysOfTheWeek.Sunday)) and i must repeat it.
Instead of 5 lines in the scheduler, i'd like only one with 5 days into this, how can i do?
I've already tried : * DaysOfTheWeek.Monday And DaysOfTheWeek.Tuesday
* DaysOfTheWeek.Monday | DaysOfTheWeek.Tuesday
but in vb.net, it's not good
I hope you understand.
Thx for any help
PS: excuse my english
Better to be drunk than idiot: that's longless
|
|
|
|

|
Hi,
I created a RunOnce task but i could not get the trigger for that on the scheduled time. can you please tell me how to get the RunOnce triggers and run the task on those triggers?
Regards,
Umesh
|
|
|
|

|
I am creating an new scheduled task using vb.net.
I need to pass a parameter to it.
Can it be done in name=value format.
Also how can i read it in other vb.net program which is scheduled.
For e.g., If I pass parameter as follows:
t.Parameters = "name=" & name
then
how can i read this parameter from the scheduled program.
|
|
|
|

|
Which software did you use to create your diagram picture?
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy
|
|
|
|

|
Hi,
My problem is task invocation in logoff mode using this library. Can i submit the task to the system account from a asp.net application, if so pl. give me the code on how to submit the job to run in logoff mode or under any login user .
Alternatively if i can submit the jobs with an admin privelege account which runs in log off mode or any user login , pl give the properties that are to be set.
I have tried by not setting TaskFlags.Interactive but no use. The batch file which is scheduled to run when the system is in logoff mode is not run.
Ur solution to this problem is higly appreciated.
with regards,
Mani Kumar.
|
|
|
|

|
I'm in the habit of entering tasks into my task list by using the old 'Click here to add a new task'.
When I copy a project to a different machine, the task list is empty...? Just for kicks, I entered the word 'zuchini' into my task list and searched my entire hard drive, including the registry, for any file containing the word.
No love.
Where does it go? I don't need to automate or extend anything, I just need to get my tasks accross to another machine. I've searched high and low, and I can't find an answer anywhere. Looks like some folks here have a solid grasp of how the task list functions...so...anyone? Anyone? Beuler?
I'd sure appreciate it-
chlock
|
|
|
|

|
I am calling the object in VB.NET successfully but when I call form ASP.NET I am not able call successfully from my IE browser. Only one time I am able to set the task scheduler successfully. Second time onwards I am getting ERROR:ACCESS DENIED at save().I have given write permissions to the relavant files and folders for my name(computerName\ASPNET). Anybody please guide me to fix the problem. If I restart my PC I can set the task only at first timne.
Thanks in advance.
Ramprasad
|
|
|
|

|
Hi Sir,
I'm trying to integrate your scheduler library in a webform. Everything works fine as it should. However, due to the fact that I'm using it on a web application, it is actually using the ASP.NET worker process to run the tool on IIS. Thus I had to grant the worker process administrator rights for the code the run. But for a web application, it is not advisable to do so. Is there any way to go around this issue?
Thanks in advance,
Bruce
|
|
|
|

|
An important feature that I have not gotten to work is being a to create a task to run under the system account. The MS documentation for Task Scheduler COM interface says to specify a "" empty string and a NULL for the password. That does not work and in the scheduler log you get:
"mytest2.job" (tasktest.bat) 7/22/2002 3:46:06 PM ** ERROR **
The attempt to log on to the account associated with the task failed, therefore, the task did not run.
The specific error is:
0x80041314: The task has been configured with an unsupported combination of account settings and run time options.
Verify that the task's Run-as name and password are valid and try again.
Does any one know how to get it to use the system account?
I have tried:
MyTask.SetAccountInformation("", Nothing)
MyTask.SetAccountInformation(Nothing, Nothing) <-- throws an exception
MyTask.SetAccountInformation("SYSTEM", Nothing)
MyTask.SetAccountInformation("NT AUTHORITY\SYSTEM", Nothing)
MyTask.SetAccountInformation("SYSTEM", "")
none of them work ~ HELP
Mark S.
mark@staffordcastle.com
|
|
|
|

|
David, I needed to access the Task Scheduler from the .Net world and I was overjoyed to find your library rather than hacking it out from scratch. I had a few design goals that the library didn't quite meet, though, so I opened the code and dove in. After more time than I should have spent, I've created a new library that seems to meet my needs.
I would like to post my version at the Code Project, but I'm not sure of the proper etiquette for a case like this. I've done enough work to claim some ownership in the code, but I certainly based it all on your work and you deserve primary credit.
Should I go ahead and post with a link to your article and also include credit in the article? That seems reasonable, but if you think my version sucks you might not appreciate the reference! Would you like to see it first?
Dennis Austin
|
|
|
|

|
Hi, I was just reading the article, great work. However, I need to know how do you test the app? I have downloaded the zipped file and ran the TestApp but I get this everytime:
Testing
C:\WINNT\system32\NOTEPAD.EXE
Testing Notepad
Author
0
Interactive
False
20
10
01:00:00
1/1/0001 12:00:00 AM
6/5/2002 10:51:00 AM
c:\test.log
High
267011
c:\
Please execuse me if I am doing something wrong but I really have no idea how to test this? Can you please help?
|
|
|
|

|
I have try your sample code locally, work fine. But when I change the line of code Dim sched As New Scheduler() to Dim sched As New Scheduler("\\server") it does not create a Task on the remote machine. Do you have any ideas or sample of what I am doing wrong ?
|
|
|
|

|
Hi ,
Its really a great tool. If u are going to release any other tool like this or other version of this pls let me know. I am now ur fun and love to do all experiments on ur tool. Please let me now ur email id also.
mys paliwalji@hotmail.com
pali
|
|
|
|

|
Again, great job with the library, it has been very useful. In the course of bringing it to bear on our project, I've fixed a few things that you and your readers might be interested to see.
First, in Trigger.Equals, the following code will result in return value of true when the underlying triggers are identical blocks of memory:
Trigger trigger = (Trigger)obj;
return trigger.InternalTaskTrigger.Equals(taskTrigger);
this method was not functional before.
Next, I noticed that you made the same mistake I did in assuming that the integer indexer in the BitVector32 class was actually indexing the bits! How silly of us to assume that MS would implement an indexer in a collection that actually made sense. A closer look at the docs shows that bitVector[i] actually looks up the bits that are represented by the integer as a mask, not the ith bit. This effects two places in the code for monthly triggers. First, in the MonthlyTrigger constructor that takes the daysOfMonth integer array, the foreach loop should look like this:
foreach (uint i in daysOfMonth)
bits[(int)Math.Pow(2, i - 1)] = true;
Second, in the MonthlyTrigger.Days property, the first for loop should look like this:
for (int i = 1; i < 32; i++)
if (bits[(int)Math.Pow(2, i - 1)]) ret[cpos++] = (uint)i;
Please let me know if you see flaws in these fixes, and thanks again for a great C# tool. Oh, as to my previous posting (anonymously), my error was that I was giving the remote computer name only, and not the address, i.e. "bobGrim", not "\\bobGrim". I would suggest changing the input parameter of the Scheduler constructor to "computerAddress", I spent about 4 hours trying to figure that one out (I ain't too bright sometimes ).
-Bob Grimshaw
|
|
|
|

|
Hi,
First just wanted to say, great job with this code. It works wonderfully well locally. I was wondering if you have had success using this library against remote computers. I have not been able to make this work. When I call call ITaskList.NewTask, the call to NewWorkItem throws an exception "System cannot find specified path". This happens when I try to call into anything, like IEnumWorkItems::Next. I've checked the obvious: I have administrative privilages on the remote computer, I can add tasks through windows to that machine, the remote registry and task scheduler services are running on the remote machine (as well as mine), and nothing has fixed this. Any ideas? Thanks.
bob grimshaw - Bob.Grimshaw@Bentley.com
|
|
|
|

|
Is there a chance to get source for the Library ?
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
A library for .NET that encapsulates the Task Scheduler COM object.
| Type | Article |
| Licence | CPOL |
| First Posted | 24 Jan 2002 |
| Views | 300,422 |
| Downloads | 4,418 |
| Bookmarked | 176 times |
|
|