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

Updated Release: Release 2.3.3 (Jun 24, 2015)

$
0
0
Some bug fixes, better support for Windows 8 additions to core library, addition of Fluent syntax, and crontab syntax, since the 1.9.4 release. Since 2.0.3 release, added support for .NET 2.0, 3.5 and 4.0, security handling, version compatibility handling (for connecting to up or down-stream versions), bug fixes, enhancements to history control and event trigger editor, compensation for deprecated email and message actions on Win8, and improved performance and marshalling. See Source Code for full details of changes. In 2.3.0, a more modern editor has been added as TaskOptionsEditor.

Download Descriptions
  • TaskScheduler.zip - Includes the base library (Microsoft.Win32.TaskScheduler.dll) with no UI code. Works with .NET 2.0 and higher. Separate assemblies for .NET 2.0, 3.5 and 4.0. Add this assembly as a reference to interact with Task Scheduler on all systems with IE4 and later. This package is also available via NuGet with package name TaskScheduler.
  • TaskSchedulerEditor.zip - Includes the UI library (Microsoft.Win32.TaskSchedulerEditor.dll) with all supporting assemblies. Works with .NET 2.0 and higher. Separate assemblies for .NET 2.0, 3.5 and 4.0. Add this assembly as a reference along with Microsoft.Win32.TaskScheduler.dll to get editor controls and dialogs that allow for viewing and editing tasks, triggers, actions, lists, etc. This package is also available via NuGet with package name TaskSchedulerEditor.
  • TaskSchedulerHelp.zip - Includes the Microsoft Help compatible help files for both the base and editor libraries. Extract all files and then run Install_TaskScheduler.bat to integrate the help.

Source code checked in, #96691

$
0
0
* Updated NuGet dependencies * Version 2.3.4

Released: Release 2.3.4 (Jun 26, 2015)

$
0
0
Some bug fixes, better support for Windows 8 additions to core library, addition of Fluent syntax, and crontab syntax, since the 1.9.4 release. Since 2.0.3 release, added support for .NET 2.0, 3.5 and 4.0, security handling, version compatibility handling (for connecting to up or down-stream versions), bug fixes, enhancements to history control and event trigger editor, compensation for deprecated email and message actions on Win8, and improved performance and marshalling. SeeSource Code for full details of changes. In 2.3.0, a more modern editor has been added as TaskOptionsEditor.

Download Descriptions
  • TaskScheduler.zip - Includes the base library (Microsoft.Win32.TaskScheduler.dll) with no UI code. Works with .NET 2.0 and higher. Separate assemblies for .NET 2.0, 3.5 and 4.0. Add this assembly as a reference to interact with Task Scheduler on all systems with IE4 and later. This package is also available via NuGet with package name TaskScheduler.
  • TaskSchedulerEditor.zip - Includes the UI library (Microsoft.Win32.TaskSchedulerEditor.dll) with all supporting assemblies. Works with .NET 2.0 and higher. Separate assemblies for .NET 2.0, 3.5 and 4.0. Add this assembly as a reference along with Microsoft.Win32.TaskScheduler.dll to get editor controls and dialogs that allow for viewing and editing tasks, triggers, actions, lists, etc. This package is also available viaNuGet with package nameTaskSchedulerEditor.
  • TaskSchedulerHelp.zip - Includes the Microsoft Help compatible help files for both the base and editor libraries. Extract all files and then run Install_TaskScheduler.bat to integrate the help.

Updated Release: Release 2.3.4 (Jun 26, 2015)

$
0
0
Some bug fixes, better support for Windows 8 additions to core library, addition of Fluent syntax, and crontab syntax, since the 1.9.4 release. Since 2.0.3 release, added support for .NET 2.0, 3.5 and 4.0, security handling, version compatibility handling (for connecting to up or down-stream versions), bug fixes, enhancements to history control and event trigger editor, compensation for deprecated email and message actions on Win8, and improved performance and marshalling. See Source Code for full details of changes. In 2.3.0, a more modern editor has been added as TaskOptionsEditor.

Download Descriptions
  • TaskScheduler.zip - Includes the base library (Microsoft.Win32.TaskScheduler.dll) with no UI code. Works with .NET 2.0 and higher. Separate assemblies for .NET 2.0, 3.5 and 4.0. Add this assembly as a reference to interact with Task Scheduler on all systems with IE4 and later. This package is also available via NuGet with package name TaskScheduler.
  • TaskSchedulerEditor.zip - Includes the UI library (Microsoft.Win32.TaskSchedulerEditor.dll) with all supporting assemblies. Works with .NET 2.0 and higher. Separate assemblies for .NET 2.0, 3.5 and 4.0. Add this assembly as a reference along with Microsoft.Win32.TaskScheduler.dll to get editor controls and dialogs that allow for viewing and editing tasks, triggers, actions, lists, etc. This package is also available via NuGet with package name TaskSchedulerEditor.
  • TaskSchedulerHelp.zip - Includes the Microsoft Help compatible help files for both the base and editor libraries. Extract all files and then run Install_TaskScheduler.bat to integrate the help.

New Post: COMException Issue

$
0
0
The only thing I can tell you is this...
The exception occurred at Microsoft.Win32.TaskScheduler.V2Interop.IRegisteredTask.get_Xml()

I don't include the debugging symbols file for the task scheduler DLL with my program.

New Post: System.IO.FileNotFoundException when selecting run times From/To dates on Vista and Win 7

$
0
0
At the moment I'm running into this problem on 64 bit Windows 10 Pro Insider Preview Build 10158. Same call works on 64 bit Windows 8.1 Pro.

System.IO.FileNotFoundException, The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at Microsoft.Win32.TaskScheduler.V2Interop.ITaskFolder.RegisterTaskDefinition(String Path, ITaskDefinition pDefinition, Int32 flags, Object UserId, Object password, TaskLogonType LogonType, Object sddl)
at Microsoft.Win32.TaskScheduler.TaskFolder.RegisterTaskDefinition(String Path, TaskDefinition definition, TaskCreation createType, String UserId, String password, TaskLogonType LogonType, String sddl)

Used .NET-Framework 2.0 - Version 2.3.4.0

New Post: System.IO.FileNotFoundException when selecting run times From/To dates on Vista and Win 7

$
0
0
Crayjin: what are you putting in for the "createType" parameter? Make sure it is CreateOrUpdate or Create. If that is still not working, try running the process in an elevated account with "Run as Administrator". Sometimes there are permission problems that seem more prevalent the new the OS version.

Created Unassigned: Windows 10 & TimeTrigger [12139]

$
0
0
When attempting to register a TimeTrigger on Windows 10 (latest preview build) the wrapper (v2.3.4) blows up and throws the following exception:

Microsoft.Win32.TaskScheduler.NotV1SupportedException occurred

Commented Unassigned: Windows 10 & RegistrationTrigger [12139]

$
0
0
When attempting to register a RegistrationTrigger on Windows 10 (latest preview build) the wrapper (v2.3.4) blows up and throws the following exception:

Microsoft.Win32.TaskScheduler.NotV1SupportedException occurred

```
var oneTimeTrigger = (RegistrationTrigger)taskDefinition.Triggers.Add(new RegistrationTrigger());
oneTimeTrigger.Delay = TimeSpan.FromSeconds(5);
```
Comments: ** Comment from web user: petersunde **

Temporary workaround:

```
var oneTimeTrigger = (TimeTrigger)taskDefinition.Triggers.Add(new TimeTrigger());
oneTimeTrigger.StartBoundary = DateTime.Now.AddSeconds(5);
```

Commented Unassigned: Windows 10 & RegistrationTrigger [12139]

$
0
0
When attempting to register a RegistrationTrigger on Windows 10 (latest preview build) the wrapper (v2.3.4) blows up and throws the following exception:

Microsoft.Win32.TaskScheduler.NotV1SupportedException occurred

```
var oneTimeTrigger = (RegistrationTrigger)taskDefinition.Triggers.Add(new RegistrationTrigger());
oneTimeTrigger.Delay = TimeSpan.FromSeconds(5);
```
Comments: ** Comment from web user: dahall **

I don't believe this is a library or OS version problem. Instead, I would guess that you entered 'true' for the last parameter (forceV1) value in the TaskService constructor forcing the library to use the old (v1) code base from Microsoft. Under V1, the RegistrationTrigger is not supported.

New Post: System.IO.FileNotFoundException when selecting run times From/To dates on Vista and Win 7

$
0
0
Hi dahall,

thanks for your response.

In fact I'm using the TaskCreation.CreateOrUpdate enum value and the process is elevated. Let me give you some more information:

I'm using a RegistrationTrigger, with a delay of 8 seconds and a EndBoundary of 20 seconds.
  • RunLevel is TaskRunLevel.LUA
  • DeleteExpiredTaskAfter is 40 seconds
  • Principal.UserId is the UserName of the Win32_ComputerSystem ManagementObject (Example: WIN-GVLEGB4ESV6\Test )
If you need further information, I'm also available on other communication channels.

New Post: System.IO.FileNotFoundException when selecting run times From/To dates on Vista and Win 7

$
0
0
Will you post the code you are using to build the task and register it? I have a Win10 instance I can test it against. I'm not getting the failure building it out on my own.

New Post: System.IO.FileNotFoundException when selecting run times From/To dates on Vista and Win 7

$
0
0
Hi dahall,

here my code:
using System;
using Microsoft.Win32.TaskScheduler;
using System.Management;

namespace TestTaskScheduler
{
    class Program
    {
        staticvoid Main(string[] args)
        {

            var ts = new TaskService();

            TaskDefinition td = ts.NewTask();
            td.RegistrationInfo.Description = "some description";
            td.Principal.LogonType = TaskLogonType.InteractiveToken;

            var computerSystemClass = new ManagementClass("Win32_ComputerSystem");
            var computerSystems = computerSystemClass.GetInstances();
            var enumerator = computerSystems.GetEnumerator();
            while (enumerator.MoveNext())
            {
                var computerSystem = enumerator.Current;
                td.Principal.UserId = (string)computerSystem["UserName"];
            }

            td.Actions.Add(new ExecAction("cmd.exe", "-someparameter"));

            // Create Triggervar trigger = new RegistrationTrigger { Enabled = true };
            trigger.Delay = TimeSpan.FromSeconds(8);
            trigger.EndBoundary = DateTime.Now + TimeSpan.FromSeconds(20);
            td.Triggers.Add(trigger);

            TaskFolder tf = ts.RootFolder;

            td.Principal.RunLevel = TaskRunLevel.LUA;

            td.Settings.StartWhenAvailable = true;
            td.Settings.Hidden = false;
            td.Settings.MultipleInstances = TaskInstancesPolicy.StopExisting;
            td.Settings.DisallowStartIfOnBatteries = false;
            td.Settings.StopIfGoingOnBatteries = false;
            td.Settings.IdleSettings.StopOnIdleEnd = false;
            td.Settings.DeleteExpiredTaskAfter = TimeSpan.FromSeconds(40);

            TaskFolder testFolder = null;

            foreach (TaskFolder taskFolder in tf.SubFolders)
            {
                if (taskFolder.Name.Equals("TEST", StringComparison.OrdinalIgnoreCase))
                {
                    testFolder = taskFolder;
                }
            }

            if (testFolder == null)
                testFolder = tf.CreateFolder("TEST");

            testFolder.RegisterTaskDefinition("Start", td, TaskCreation.CreateOrUpdate, null, null, TaskLogonType.InteractiveToken);
            Console.ReadKey();
        }
    }
}

Closed Unassigned: Windows 10 & RegistrationTrigger [12139]

$
0
0
When attempting to register a RegistrationTrigger on Windows 10 (latest preview build) the wrapper (v2.3.4) blows up and throws the following exception:

Microsoft.Win32.TaskScheduler.NotV1SupportedException occurred

```
var oneTimeTrigger = (RegistrationTrigger)taskDefinition.Triggers.Add(new RegistrationTrigger());
oneTimeTrigger.Delay = TimeSpan.FromSeconds(5);
```

Closed Unassigned: TriggerEditDialog: DateTime out of range [12117]

$
0
0
Run this code:
var trigger = new TimeTrigger();
trigger.EndBoundary = new DateTime(2016, 1, 1);
var dialog = new TriggerEditDialog(trigger, supportV1Only: false);
dialog.ShowDialog();

Then interactive with the dialog:
1. Uncheck Expire
2. Change to "At log on"
3. Uncheck Activate
4. Change to "On a schedule".

The following exception is thrown:

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in System.Windows.Forms.dll
Additional information: Value of '0001-01-01 00:00:00' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.

Closed Unassigned: Recently we got AccessViolationException [12019]

$
0
0
Hi! Recently we've got the following exception. It happened one time and we cannot reproduce it.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Microsoft.Win32.TaskScheduler.V2Interop.IRegisteredTask.get_Definition()
at Microsoft.Win32.TaskScheduler.Task.GetV2Definition(TaskService svc, IRegisteredTask iTask, Boolean throwError)
at Microsoft.Win32.TaskScheduler.Task.get_Definition()


We run our WPF application on Win7, .Net 3.5.

Created Issue: System.IO.FileNotFoundException when registering task under 64 bit Windows 10 Pro Insider Preview Build 10158 [12142]

$
0
0
At the moment I'm running into this problem on 64 bit Windows 10 Pro Insider Preview Build 10158. Same call works on 64 bit Windows 8.1 Pro.

System.IO.FileNotFoundException, The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at Microsoft.Win32.TaskScheduler.V2Interop.ITaskFolder.RegisterTaskDefinition(String Path, ITaskDefinition pDefinition, Int32 flags, Object UserId, Object password, TaskLogonType LogonType, Object sddl)
at Microsoft.Win32.TaskScheduler.TaskFolder.RegisterTaskDefinition(String Path, TaskDefinition definition, TaskCreation createType, String UserId, String password, TaskLogonType LogonType, String sddl)

Used .NET-Framework 2.0 - Version 2.3.4.0

In fact I'm using the TaskCreation.CreateOrUpdate enum value and the process is elevated. Let me give you some more information:

I'm using a RegistrationTrigger, with a delay of 8 seconds and a EndBoundary of 20 seconds.
* RunLevel is TaskRunLevel.LUA
* DeleteExpiredTaskAfter is 40 seconds
* Principal.UserId is the UserName of the Win32_ComputerSystem ManagementObject (Example: WIN-GVLEGB4ESV6\Test )

```
using System;
using Microsoft.Win32.TaskScheduler;
using System.Management;

namespace TestTaskScheduler
{
class Program
{
static void Main(string[] args)
{

var ts = new TaskService();

TaskDefinition td = ts.NewTask();
td.RegistrationInfo.Description = "some description";
td.Principal.LogonType = TaskLogonType.InteractiveToken;

var computerSystemClass = new ManagementClass("Win32_ComputerSystem");
var computerSystems = computerSystemClass.GetInstances();
var enumerator = computerSystems.GetEnumerator();
while (enumerator.MoveNext())
{
var computerSystem = enumerator.Current;
td.Principal.UserId = (string)computerSystem["UserName"];
}

td.Actions.Add(new ExecAction("cmd.exe", "-someparameter"));

// Create Trigger
var trigger = new RegistrationTrigger { Enabled = true };
trigger.Delay = TimeSpan.FromSeconds(8);
trigger.EndBoundary = DateTime.Now + TimeSpan.FromSeconds(20);
td.Triggers.Add(trigger);

TaskFolder tf = ts.RootFolder;

td.Principal.RunLevel = TaskRunLevel.LUA;

td.Settings.StartWhenAvailable = true;
td.Settings.Hidden = false;
td.Settings.MultipleInstances = TaskInstancesPolicy.StopExisting;
td.Settings.DisallowStartIfOnBatteries = false;
td.Settings.StopIfGoingOnBatteries = false;
td.Settings.IdleSettings.StopOnIdleEnd = false;
td.Settings.DeleteExpiredTaskAfter = TimeSpan.FromSeconds(40);

TaskFolder testFolder = null;

foreach (TaskFolder taskFolder in tf.SubFolders)
{
if (taskFolder.Name.Equals("TEST", StringComparison.OrdinalIgnoreCase))
{
testFolder = taskFolder;
}
}

if (testFolder == null)
testFolder = tf.CreateFolder("TEST");

testFolder.RegisterTaskDefinition("Start", td, TaskCreation.CreateOrUpdate, null, null, TaskLogonType.InteractiveToken);
Console.ReadKey();
}
}
}
```

Edited Issue: System.IO.FileNotFoundException when registering task under 64 bit Windows 10 Pro Insider Preview Build 10158 [12142]

$
0
0
At the moment I'm running into this problem on 64 bit Windows 10 Pro Insider Preview Build 10158. Same call works on 64 bit Windows 8.1 Pro.

System.IO.FileNotFoundException, The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at Microsoft.Win32.TaskScheduler.V2Interop.ITaskFolder.RegisterTaskDefinition(String Path, ITaskDefinition pDefinition, Int32 flags, Object UserId, Object password, TaskLogonType LogonType, Object sddl)
at Microsoft.Win32.TaskScheduler.TaskFolder.RegisterTaskDefinition(String Path, TaskDefinition definition, TaskCreation createType, String UserId, String password, TaskLogonType LogonType, String sddl)

Used .NET-Framework 2.0 - Version 2.3.4.0

In fact I'm using the TaskCreation.CreateOrUpdate enum value and the process is elevated. Let me give you some more information:

I'm using a RegistrationTrigger, with a delay of 8 seconds and a EndBoundary of 20 seconds.
* RunLevel is TaskRunLevel.LUA
* DeleteExpiredTaskAfter is 40 seconds
* Principal.UserId is the UserName of the Win32_ComputerSystem ManagementObject (Example: WIN-GVLEGB4ESV6\Test )

```
using System;
using Microsoft.Win32.TaskScheduler;
using System.Management;

namespace TestTaskScheduler
{
class Program
{
static void Main(string[] args)
{

var ts = new TaskService();

TaskDefinition td = ts.NewTask();
td.RegistrationInfo.Description = "some description";
td.Principal.LogonType = TaskLogonType.InteractiveToken;

var computerSystemClass = new ManagementClass("Win32_ComputerSystem");
var computerSystems = computerSystemClass.GetInstances();
var enumerator = computerSystems.GetEnumerator();
while (enumerator.MoveNext())
{
var computerSystem = enumerator.Current;
td.Principal.UserId = (string)computerSystem["UserName"];
}

td.Actions.Add(new ExecAction("cmd.exe", "-someparameter"));

// Create Trigger
var trigger = new RegistrationTrigger { Enabled = true };
trigger.Delay = TimeSpan.FromSeconds(8);
trigger.EndBoundary = DateTime.Now + TimeSpan.FromSeconds(20);
td.Triggers.Add(trigger);

TaskFolder tf = ts.RootFolder;

td.Principal.RunLevel = TaskRunLevel.LUA;

td.Settings.StartWhenAvailable = true;
td.Settings.Hidden = false;
td.Settings.MultipleInstances = TaskInstancesPolicy.StopExisting;
td.Settings.DisallowStartIfOnBatteries = false;
td.Settings.StopIfGoingOnBatteries = false;
td.Settings.IdleSettings.StopOnIdleEnd = false;
td.Settings.DeleteExpiredTaskAfter = TimeSpan.FromSeconds(40);

TaskFolder testFolder = null;

foreach (TaskFolder taskFolder in tf.SubFolders)
{
if (taskFolder.Name.Equals("TEST", StringComparison.OrdinalIgnoreCase))
{
testFolder = taskFolder;
}
}

if (testFolder == null)
testFolder = tf.CreateFolder("TEST");

testFolder.RegisterTaskDefinition("Start", td, TaskCreation.CreateOrUpdate, null, null, TaskLogonType.InteractiveToken);
Console.ReadKey();
}
}
}
```

New Post: System.IO.FileNotFoundException when selecting run times From/To dates on Vista and Win 7

$
0
0
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.

New Post: System.IO.FileNotFoundException when selecting run times From/To dates on Vista and Win 7

Viewing all 2206 articles
Browse latest View live


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