if i have a windows scheduled task that runs my EXE. is there a way from inside my EXE to find the scheduled task instance that triggered me?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Easy answer for that would be: no.
Best thing you could do is programatically access either the task scheduler library and see whether the process you are is in “running” mode, get the PID of the process (scheduler actually writes it out in its history) and compare it to yours.
Easier thing to do would be accessing to system event logs and seeing if there’s any mention of execution your exe file (though they may not be such a log if the exe was actually executed).
The only thing you can associate with your process is the caller (which might be NETWORK SERVICE or some predefined account) which do not give any information regarding it being scheduled.