Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all 2206 articles
Browse latest View live

New Post: Setting and 'hide'

$
0
0
First of all Thanks for the great work here!

I created a schedule successfully, The user could see the program run. I need this to run in the background as this is a technical application that a standard user should not see.

Can anyone advise how i would go about doing this.

NOTE: Junior developer in first year of employment so have a limited knowledge just now

Thanks in advance,

New Post: Setting and 'hide'

$
0
0
If you want the program to run in the user's space, then it must be run interactively within their account (like it is now). To run it minimized, you can launch it from a minimized cmd window or a PowerShell script. The cmd window line would be "cmd.exe" for the executable and arguments would be "/Q /E:ON /C start /MIN app.exe".

Commented Unassigned: Inheritance security rules violated while overriding member [12037]

$
0
0
I'm trying to write a NAnt extension that uses this library but I get this exception on my first method that loads the taskscheduler objects.

System.TypeLoadException: Inheritance security rules violated while overriding member: 'Microsoft.Win32.TaskScheduler.TaskService.System.Runtime.Serialization.ISerializab
le.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must mat
ch the security accessibility of the method being overriden.

I'm assuming this is related to NAnt dynamically loading the extension dll but I'm not sure how to get around it. Previously we were using the taskscheduler 1.0 library via NAnt without any issues.

```
public void test()
{
using (Microsoft.Win32.TaskScheduler.TaskService ts = new Microsoft.Win32.TaskScheduler.TaskService())
{
// Create a new task definition and assign properties
Microsoft.Win32.TaskScheduler.TaskDefinition td = ts.NewTask();
td.RegistrationInfo.Description = "Does something";

// Create a trigger that will fire the task at this time every other day
td.Triggers.Add(new Microsoft.Win32.TaskScheduler.DailyTrigger { DaysInterval = 2 });

// Create an action that will launch Notepad whenever the trigger fires
td.Actions.Add(new Microsoft.Win32.TaskScheduler.ExecAction("notepad.exe", "c:\\test.log", null));

// Register the task in the root folder
ts.RootFolder.RegisterTaskDefinition(@"Test", td);

}
}
```
Comments: ** Comment from web user: digdug **

Hi, I went back and looked at this again today. I was still getting the same error but then deleting Microsoft.Win32.TaskScheduler.dll and replacing it with the one attached again (even though they were same size and datestamp) fixed my issue. So, somehow it must have been calling into the old version of the dll.

So, that solves my problem. Thanks!!!

New Comment on "ActionSamples"

$
0
0
about the EmailAction where to put the authenticated password of from account

Closed Unassigned: Inheritance security rules violated while overriding member [12037]

$
0
0
I'm trying to write a NAnt extension that uses this library but I get this exception on my first method that loads the taskscheduler objects.

System.TypeLoadException: Inheritance security rules violated while overriding member: 'Microsoft.Win32.TaskScheduler.TaskService.System.Runtime.Serialization.ISerializab
le.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must mat
ch the security accessibility of the method being overriden.

I'm assuming this is related to NAnt dynamically loading the extension dll but I'm not sure how to get around it. Previously we were using the taskscheduler 1.0 library via NAnt without any issues.

```
public void test()
{
using (Microsoft.Win32.TaskScheduler.TaskService ts = new Microsoft.Win32.TaskScheduler.TaskService())
{
// Create a new task definition and assign properties
Microsoft.Win32.TaskScheduler.TaskDefinition td = ts.NewTask();
td.RegistrationInfo.Description = "Does something";

// Create a trigger that will fire the task at this time every other day
td.Triggers.Add(new Microsoft.Win32.TaskScheduler.DailyTrigger { DaysInterval = 2 });

// Create an action that will launch Notepad whenever the trigger fires
td.Actions.Add(new Microsoft.Win32.TaskScheduler.ExecAction("notepad.exe", "c:\\test.log", null));

// Register the task in the root folder
ts.RootFolder.RegisterTaskDefinition(@"Test", td);

}
}
```

New Comment on "ActionSamples"

$
0
0
aabdelhameed: If you email server supports putting passwords in header fields, you can use the HeaderFields property and add the name and the password as the value. If not, then I'm afraid this library will not support secured email accounts.

New Post: Open to new trigger window

$
0
0
Hi guys, I've been using the "EditorForm.Initialize" command to open the editor form, but is there a way to have it open directly into the triggers / new trigger form?

At the moment I've got the editor opening but it opens on the "general" tab, so the user then has to click the Triggers tab, then on New.

I'd much prefer if it opened directly to the new trigger window. Is that possible?

New Post: Open to new trigger window

$
0
0
There is not a simple property that will allow this. However you can use a sneaky method for doing this, though it has risks of internals breaking it in the future so definitely make sure you build in error handling.
using (TaskService mgr = new TaskService())
{
  var dlg = new TaskEditDialog(mgr.RootFolder.Tasks[0], false, false);
  try
  {
    TabControl tabs = dlg.Controls["taskPropertiesControl1"].Controls["tabControl"] as TabControl;
    TabPage triggerTab = dlg.Controls["taskPropertiesControl1"].Controls["tabControl"].Controls["triggersTab"] as TabPage;
    if (tabs != null && triggerTab != null)
      tabs.SelectedTab = triggerTab;
  }
  catch { }
  dlg.ShowDialog(this);
}

New Post: Open to new trigger window

$
0
0
dahall, that opens the window directly into the "Triggers" tab which is great, but is it also possible to have it open to the "New Trigger" window - instead of having to press the "New" button?

Not a big problem as they could just press the button, but would be nice.

Thanks and appreciate your help,

New Post: Open to new trigger window

$
0
0
If you just need to create a new trigger, then use the TriggerEditDialog.

New Post: Advanced settings->Repeat Task every - where can I find this setting the API?

$
0
0
I am looking at editing a Time Trigger. In advanced settings I see an option to Repeat Task every X time/date for a duration of y time/date.

Where can I find this in the API?

New Post: Advanced settings->Repeat Task every - where can I find this setting the API?

New Post: Add task from xml string

$
0
0
How i can add task from xml string ? Not from xml file. I am going to get xml tasks from ms sql database.

New Post: Advanced settings->Repeat Task every - where can I find this setting the API?

New Post: Add task from xml string


New Post: Windows 10 Support

$
0
0
I found an issue in other place. Wrapper cannot get definition for some preinstalled tasks.
For example win 10 has next task "\Microsoft\Windows\CertificateServicesClient\UserTask". When I try to get task.Definition.RegistrationInfo.Description I get an error:
"{"(1,524):WnfStateChangeTrigger:"}"
with stackTrace:
at Microsoft.Win32.TaskScheduler.V2Interop.ITaskDefinition.set_XmlText(String value)
at Microsoft.Win32.TaskScheduler.Task.GetV2Definition(TaskService svc, IRegisteredTask iTask, Boolean throwError)
at Microsoft.Win32.TaskScheduler.Task.get_Definition()

Created Unassigned: Release 2.3.1 bug with .NET 3.5 [12088]

$
0
0
Hello,

I am testing the release 2.3.1 over the previous 2.0.3 with .NET 3.5. I took the 2.0 version of the dll and I have compilation errors.
Some types from System.Core v3.5.0.0 have the same names as types in Microsoft.Win32.TaskScheduler.dll:
System.Diagnostics.Eventing.Reader.PathType
System.Diagnostics.Eventing.Reader.EventRecord

I am getting:
The type 'System.Diagnostics.Eventing.Reader.PathType' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\64cd053d\cb6b2d6d\assembly\dl3\2fe9cd28\002ef9be_1064d001\Microsoft.Win32.TaskScheduler.DLL'
and 'c:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll'

Can you rename those or do a .NET 3.5 special version?

Thanks

Source code checked in, #95421

$
0
0
* Updates to allow for use in Windows 10 preview builds * Reconfigured test app to build for .NET 2 & 4

New Post: Windows 10 Support

$
0
0
I have found the problems and corrected in the latest source code drop and they will be included in the next release (2.3.2). Unfortunately, the .NET runtimes do not return new values for Windows 10 and the registry values in the preview builds are inconsistent. For now, a hack will make things work but there will have to be another change once Windows 10 is released.

New Post: Windows 10 Support

$
0
0
Thank you!
Let's hope Win 10 fixes it and does not throw too many surprises in the next release. )
Viewing all 2206 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>