How to distinguish between Task Scheduler 1.0 and Task Scheduler 2.0?

I have a C # application that uses Task Scheduler 1.0 (.job files). I need to expand an application to support Task Scheduler 2.0 (xml).

I need code that can tell me what TS is running on the current client machine. Is it possible?

+3
source share
2 answers

Task Scheduler 2.0 introduces the ITaskService interface and scripting support. Therefore, you can try if a COM object for this class exists or not. For instance,

var t = Type.GetTypeFromProgID("Schedule.Service");
if (null != t) 
{
   // we definitely have 2.0 version
}
else
{
  // 1.0 version
}

: . prog id MSDN: http://msdn.microsoft.com/en-us/library/aa446862(v=VS.85).aspx

+5

schedsvc.dll( , ), , , , . http://msdn.microsoft.com/en-us/library/aa446802(VS.85).aspx,

Microsoft .

Task Scheduler 1.0 Windows Server 2003, Windows XP, Windows 2000.

2.0 Windows Vista Windows Server 2008.

0

Source: https://habr.com/ru/post/1781606/


All Articles