Answered by:
Monitoring other process's instances

Question
-
I have a process,TaskScheduler.exe which schedule tasks and there is another process, InvokeTasks.exe which invoke task as the TaskScheduler.exe's scheduling.
For example, following data is the schduling by the TaskScheduler.exe.
title path start time type -------------------- ----------------------------- ---------------------------- ----------- One time backup c:\Backup\task1.exe 08/01/2018 12:00:00 AM one time Daily backup c:\Backup\task2.exe 08/01/2018 12:00:00 AM daily Weekly backup c:\Backup\task3.exe 08/01/2018 12:00:00 AM weekly Monthly backup c:\Backup\task4.exe 08/01/2018 12:00:00 AM monthly
InvokeTasks.exe has a class of which name is MyTask and this class has a timer to handle the schedule for a task.
I will instantiate 4 times with MyTask class for the scheduling data created in the TaskScheduler.exe.
My question is following.
1. What is the correct way to name the object of the class's instances for each tasks in MyTask.exe?
Should I use array to grant different name for each instances(object)?
2. Can I monitor each instances of the TaskScheduler.exe's MyTask class from the TaskScheduler.exe?
Thursday, August 2, 2018 6:21 PM
Answers
-
1) It depends. Say whether you need to provide UI for user manipulation (say start and stop of tasks).
2) You can record the ProcessId returned from Process.Start() and use it to get access to the process started later.
- Proposed as answer by Zhanglong WuMicrosoft contingent staff Friday, August 3, 2018 5:15 AM
- Marked as answer by Jeff0803 Friday, August 3, 2018 8:43 PM
Friday, August 3, 2018 1:32 AMAnswerer
All replies
-
1) It depends. Say whether you need to provide UI for user manipulation (say start and stop of tasks).
2) You can record the ProcessId returned from Process.Start() and use it to get access to the process started later.
- Proposed as answer by Zhanglong WuMicrosoft contingent staff Friday, August 3, 2018 5:15 AM
- Marked as answer by Jeff0803 Friday, August 3, 2018 8:43 PM
Friday, August 3, 2018 1:32 AMAnswerer -
1) It depends. Say whether you need to provide UI for user manipulation (say start and stop of tasks).
=> I don't need UI for manipulation(No start/stop of tasks)
2) You can record the ProcessId returned from Process.Start() and use it to get access to the process started later.
=> My sentence in the inquiry was not correct.(my mistake)
Here is my question again.
2. Can I monitor each instances of the InvokeTasks.exe's MyTask class from the TaskScheduler.exe?
Friday, August 3, 2018 8:43 PM -
1) In that case, you can name the classes any way you like.
2) There are a number of methods, range from using pipe/tcp client to do interprocess communication, or just employ a simple Access database to store the PID/status of tasks in a table.
Monday, August 6, 2018 1:07 AMAnswerer