Process ID of a process started by the NT Task Scheduler

I need to find the process id of a task that has been started by the Windows NT task scheduler. I can query the iTask interface to see if a task is running but can't see any way to get it's process id.

I did think maybe the process itself could put its process Id into the iTask's WorkItemData when it starts up, but then I have the problem of discovering whether the process was actually started from the Task Scheduler and, if so, which task it is! 

The only method I can think of is to generate a unique Id whenever I add a task to the Scheduler and include a switch in the command line of the task, specifying that id. The task can then enumerate all the Scheduler tasks until it finds the one with the passed in Id.

Surely the NT Task Scheduler must already know the process id in order for IScheduledWorkItem::Terminate() to work?

--- Al.


0
anonymous (74722)
1/23/2004 12:11:07 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1001 Views

Similar Articles

[PageSpeed] 33

Does Process32First()/Process32Next() help?

"Al" <anonymous@discussions.microsoft.com> wrote in message
news:62FE476B-0D79-462B-85F6-EB7833FA7AFB@microsoft.com...
> I need to find the process id of a task that has been started by the
Windows NT task scheduler. I can query the iTask interface to see if a task
is running but can't see any way to get it's process id.
>
> I did think maybe the process itself could put its process Id into the
iTask's WorkItemData when it starts up, but then I have the problem of
discovering whether the process was actually started from the Task Scheduler
and, if so, which task it is!
>
> The only method I can think of is to generate a unique Id whenever I add a
task to the Scheduler and include a switch in the command line of the task,
specifying that id. The task can then enumerate all the Scheduler tasks
until it finds the one with the passed in Id.
>
> Surely the NT Task Scheduler must already know the process id in order for
IScheduledWorkItem::Terminate() to work?
>
> --- Al.
>
>


0
1/23/2004 1:35:38 PM
I don't think so. It would enable me to find running instances of that executable, but there could be several, all having been started with different parameters The structure returned by these functions does not seem to include the parameters

--- Al
    
     ----- David Crow [MCSD] wrote: ----
    
     Does Process32First()/Process32Next() help
    
     "Al" <anonymous@discussions.microsoft.com> wrote in messag
     news:62FE476B-0D79-462B-85F6-EB7833FA7AFB@microsoft.com..
     > I need to find the process id of a task that has been started by th
     Windows NT task scheduler. I can query the iTask interface to see if a tas
     is running but can't see any way to get it's process id
     >> I did think maybe the process itself could put its process Id into th
     iTask's WorkItemData when it starts up, but then I have the problem o
     discovering whether the process was actually started from the Task Schedule
     and, if so, which task it is
     >> The only method I can think of is to generate a unique Id whenever I add 
     task to the Scheduler and include a switch in the command line of the task
     specifying that id. The task can then enumerate all the Scheduler task
     until it finds the one with the passed in Id
     >> Surely the NT Task Scheduler must already know the process id in order fo
     IScheduledWorkItem::Terminate() to work
     >> --- Al
     >>
0
anonymous (74722)
1/23/2004 2:46:05 PM
Reply:

Similar Artilces:

Moving Tasks
Hi, I have a baseline plan which has two phases (initial and final). Few tasks in the initial phase are not done due to the non-availability of planned resources. Final phase is planned to start from next week and please let me know how to move those tasks from initial to final phase. Regards Naga What is it you did you distinguish in Project the difference between the initial and final phases? What "barrier" is stopping uncompleted work moving forward when you update the schedule with progress? Perhaps you have constraints on the tasks in the initial phase (...

How do I associate task list with another calendar?
I have an extensive task list that shows in one calendar view. I would like it to show in another. Can I associate it, or does it have to all be reentered? "holyharvester" <holyharvester@discussions.microsoft.com> wrote in message news:1A0249B2-3A52-43ED-9509-E65851724BD9@microsoft.com... >I have an extensive task list that shows in one calendar view. I would like > it to show in another. Can I associate it, or does it have to all be > reentered? You first: state your Outlook version. -- Brian Tillman [MVP-Outlook] Only the default task list dis...

Event ID 3009 A non-delivery report with a status code of 5.1.0 appears randomly.
Exchange 2003 mail enabled Public Folder randomly don't receive e-mail from external sender, when it happens sender receives error : --------------------------------------------- Final-Recipient: rfc822;xxx@xxx.com Action: failed Status: 5.1.0 --------------------------------------------- Sometimes all work ok. Error in Application log : --------------------------------------------- Event Type: Error Event Source: MSExchangeTransport Event Category: (8) Event ID: 3009 Date: 2005.12.21 Time: 11:43:32 User: N/A Computer: MailServerName Description: The description for Event ID ( 3009 ...

"Show Placeholders" in options/view menu does'nt work.
I have a macro that places a large number of pictures on a spreadsheet. I would like the pictures to show as "placeholders" to speed up viewing/editing. The only problem is that this feature (under Tools/Options/View) does not work. All the images are being display normally. I have tried this in Excel 2000/2003/XP with the same result. This feature works great in MS Word. Please help. To see what I'm talking about. Go to Tools/Options/View and check the "Show Placeholders" option. Now insert a picture or clipart. The image will be displayed normally instead of just a b...

Create and assign an outlook task using VBA?
I have code that creates an Outlook task for me. I want to be able to automatically assign a task to a certain e-mail address recipient. Is this possible? It seems that the right properties are available, but I can't seem to get it to work. Here is my code... Private Sub Create_It_Click() 'Create the Task in Outlook On Error GoTo AddAppt_Err Dim outobj As Outlook.Application Dim outtask As Outlook.TaskItem 'Dim objApptOccur As TaskItem Set outobj = CreateObject("outlook.application") Set outtask = outobj.CreateItem(olTas...

Keep getting task pop 3 Send /Recieve Error 0x800 40 900
Outlook 2003 when I hit send /recieve to get mail the above notification appears, does this mean I have messages but unable to access them due to the error or could there be another explanation. Cheers Neil Is this a newly set up account? Did it ever work before? Have you checked with your ISP to verify your account settings? Check their website for the server details. Make sure you have spelled everything correctly in the account details - this is in the Control Panel mail applet. "Neil" <Neil@discussions.microsoft.com> wrote in message news:A8D1CE45-5CE2-4651-850F-DA514...

Updating task list in calendar view
I have just recently begun using Outlook, so please forgive the newbie question. Whenever I get a daily calendar view with the task pane on the right, the task list includes all tasks, current and future. I can configure the Outlook Today window to just current tasks and I know that there has to be a way to do the same thing with the calendar view. Can someone point me in the right direction? Thanks, Charles right click on the task list and change the view. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual...

RMS 2.0 hangs when processing Payment
Hi, I have a back office 'server' and two registers. All are XP SP2. Most sales are rung up on Reg. 2 and Reg. 1 is used primarily for lookups and receiving. Reg 1 is also the PC Charge 'server'. Lately when it gets busy Reg 2 has been getting slower and slower on the Processing payment screen. Eventually it just freezes - not just the register but all of RMS. All three computers have to be rebooted for the system to work. There is no rhyme or reason that I can find. The DB is 10560KB, there is not a single item or payment type that is used when it freezes and au...

Transport Problem ! from NT to XP
-------------------------------------------------------------------------------- Working Environment Working in vc++6.0 Windows version XP -------------------------------------------------------------------------------- I have created a multi-threaded application which works without any problems on a NT-4.0 Workstation/Server. When I try to run the same application in Windows XP, I get an error in a call to CoMarshalInterThreadInterfaceInStream which returns -2147418113. Then i implemented GIT instead of CoMarshalInterThreadInterfaceInStream. it was working fine in all the compone...

Appointment start time changed to one hour later in OWA
I currently have a problem with exchange server 2000 and OWA. When a client opens and accepts an appointment through OWA the appointment time is changed to be one hour later than the appointment time should be. I have found KB article 818379 which describes this problem, and says to install september post sp3 rollup. After applying these updates and re-booting the exchange server, the problem still exists. Has anyone come across this problem before? Our setup includes 5 exchange servers across 3 sites, with 2 sites having both a front-end and back-end exchange server. Both the front-end and ba...

Re: Finalizing the concurrent processing of current accounts with new Windows Live accounts.
Glad to see you're sticking with me. :-) Well, I'll be darned, apparently I was worried about nothing! Thanks to your info, I sent a test message to my Live account, and I got it! Now I'll set up a rule for each account to send everything to the (old) corresponding folder, and I'm up and running. *** Um-m-m, not yet. I sent an email to the Live account and my rule said for that account it should move it to the old corresponding folder, but it didn't get moved. It simply landed in the Inbox folder for the Live account. So I did the Run Rules Now optio...

Statistical Process Control chart
Has anyone drawn SPC Chart in Microsoft Excel? Hi, Maybe have a look here http://peltiertech.com/Excel/Charts/statscharts.html http://www.processtrends.com/pg_charts_control_chart.htm Cheers Andy Tang Leep Boon wrote: > Has anyone drawn SPC Chart in Microsoft Excel? -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info ...

Quicksell 2000 credit card processing
I am still running Quicksell for my small independent bookstore. I've tried to start the upgrade process to RMS but never found a partner who could talk me through the trial version, so I've decided to stick with Quicksell but upgrade my printer and credit card technology. At the moment, I'm running an old Epson dot matrix receipt printer through my parallel port. I'd like to buy a faster, thermal receipt printer but I've read that people had problems processing credit cards through printers without a USB port. However, will I be able to use a USB printer with Quic...

Shudown outlook remotely/or on a schedule
I want to backup my PST files... To do that, Outlook can't be running... Is there a way to PROPERLY shutdown Outlook 2007 either on a schedule or from a command line? Oh yea, and by pass the "Backup" command at the same time.... I found lots of programs to shutdown everything, but I don't want to do that, only OUTLOOK so I can backup it's stuff. If I shutdown everything, the backup routine gets killed also... Thanks Bob If you install the backup addin, from MS OL will be backed up on closing But then you might want an automatic solution provided by third pa...

Can an invoice contain 2 site IDs
We have a situation where users are billing items on one invoice with more than one location, these parrticular docments intermittenlty come up with wrong tax calculations. Question-is it practical to change location ids and why would we have wrong tax calculation? I have not had any issues with multi-site invoices. Tax calculations may appear to be incorrect if you have the wrong tax schedule ID assigned to the site (if using item-based tax calculation) or wrong tax schedule ID assigned to the customer ship to address at the line item level (if using customer-based tax calculation). ...

Converting mails to tasks
Hi All, Is there a way where we can convert the incoming mails to tasks using some task template? If so, please let me know how. Thanks, Vinay. Check this page for some possibilities: http://www.slipstick.com/addins/tasks.htm -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered -- please reply only to the newsgroup to preserve the message thread. *** In news:0b0301c3a9af$814353b0$a101280a@phx.gbl, Vinay Urs wrote: > Hi All, > > Is there a way where we can convert the incoming mails to > tasks using some task template? > > ...

How to make a Sales Process Die?
We had a sales process set up, and then decided it was not what we wanted. I deactivated it, and deleted it in workflow manager. Unfortunately, the opportunities set up under this process cannot be dissassociated form the Sales process, and there doesn't seem to be any way to purge the Sales process from these records. It also causes some strange results on the Opportunity by sales stage reports. Anyone know how to purge a Sales process Completely from the system?? Thanks Only way around this would be to recreate the opportunities. I do not know what affect deleting the sa...

appointment scheduler
Is there an add-on or something for Excel that will notify you of up coming appointments or events? Bill Bill Not built in, you could colour something with conditional formatting or write event code to fire when the workbook opens, but you would be much better doing this in Outlook or some other PIM -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS www.nickhodge.co.uk "Bill" <wjjeannette@meeci.com> wrote in message news:u481%23Ni8GHA.4620@TK2MSFTNGP02.phx.gbl... > Is there an add-on or something for Excel that...

editing budgets from a managed scheduled deposit
I have added my salary into the 'managed scheduled deposit' section giving details as 'every other week'. The budget, however, under the heading of 'review your current budget status' shows double the actuals amount. (That is the budget shows an incorrect amount compared to the actuals forecasted in the scheduled deposit page). If I select "Wages and Salary : Gross Pay" and click on 'edit item' at the bottom of the page, the pop-up window asks me what to edit. When I click on the the down arrow, the salary account shows three transaction re...

start up problem 12-29-09
windows doesn't start get error message: windows\driver\pci.sys missing or corrupted reloaded windows xp twice and after 48 hours problem again any ideas? On Dec 29, 1:27=A0am, backten <back...@discussions.microsoft.com> wrote: > windows doesn't start get error message: > windows\driver\pci.sys missing or corrupted > reloaded windows xp twice and after 48 hours problem again > any ideas? Do you mean something like: Windows could not start because the following file is missing or corrupt: System32\drivers\pci.sys It could be that the pci.sys file re...

Data Protection Mangager 2010 failed to start
One server that was backing up just fine is now no longer backing up. I'm not sure where to go from here as searching newsgroups and forums are not providing any answers. The following is the error code that I'm getting: Backup attempted at '4/20/2010 3:47:48 PM' failed to start, error code '2155348081'. Log Name: Microsoft-windows-Backup/Operational Source: Backup EventID: 19 Level: Error User: SYSTEM OpCode: Info Task Category: None Any help pointing me into the right direction would be greatly appreciated :) The event that ...

Tasks in Outlook Today #2
I am trying to configure Outlook Today in Outlook 2003. The general layout as well as the display of appointments and messages are ok. But it seems that I can not configure the tasks the way I want them using the customize page: - Show tasks from today and older - Sort first according to age (new to old), then according to priority (high to low) - Optional: Do not mark (over)due tasks Any idea how to do this, even if I have to create a page manually? Best regards, Bernd very little customization is available for the outlook today page... so you'll need to make one yourself. It's n...

Directory Structure starting with the Current Directory ..
Hi, Could someone Pls tell me how do i do this: In my macro the user gets to select the file to open: ExcelFile1 = Application.GetOpenFilename("Excel- files,*.xls", _ 1, "Select Input File To Open", , False) My requirement is the Windows explorer should show the directory structure starting with the Current Directory rather than showing the directory structure Starting with desktop or some other. Thanks in Advance for any help. Neeraja. ...

Tasks not following date change
I recently had a drive crash and had to save all my appointments and tasks from my back-up file to another laptop. The save went fine but now when I click on another date in the calendar box above the task pad display the calendar of appointments goes to the selected date but the tasks stay the same. To view scheduled tasks on another day I have to change the date in the laptop's clock settings to fool the task display into thinking it's that day. Previously, when I selected a different day, both the appointments AND the tasks changed. I am using Outlook 2000 and can't fi...

Active synch error event id 3005
Hi all I am running exchange 2003 sp1 jsut recently i have a user who everytime he synchs i get an error in the app log on the server, its event ID 3005 Unexpected Exchange mailbox Server error: Server: [thebeast.insuranceskillscenter.com] User: [joeuser@domain.com] HTTP status code: [502]. Verify that the Exchange mailbox Server is working correctly. Any idea on what is causing this? Thanks ...