Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Windows Scheduled Tasks - Get schedule details by program name

Windows Scheduled Tasks - Get schedule details by program name

Windows Scheduled Tasks - Get schedule details by program name

I'm trying to find out whether a specific executable has been scheduled, if so, where that file is located.

For example, if notepad.exe is scheduled and being run from f:\somefolder\notepad.exe.  I need to get "f:\somefolder\"

I'm coding this in Delphi, but I'm not finding a suitable API.. so as a consolation, I'm looking at just running dos commands.

I'm not super good with batch, and this is as far as I've gotten:


schtasks /query /V /FO CSV | grep -i "NOTEPAD.EXE"

This returns a long string that contains the info I need:


"MyWorkstation","\run something","11/02/2011 1:26:35 PM","Ready","Interactive only","N/A","1","MyUserName","F:\somefolder\Notepad.exe ","N/A","N/A","Enabled","Disabled","Stop On Battery Mode, No Start On Batteries","MyUserName","Enabled","72:00:00","Scheduling data is not available in this format.","Weekly","N/A","N/A","N/A","WED","Every 1 w

Does anyone know of a more direct way in the form of windows api or even a cmd string that will just return "f:\somefolder\notepad.exe" in this example?


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close