steve4king
IS-IT--Management
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:
This returns a long string that contains the info I need:
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?
Thanks!
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:
Code:
schtasks /query /V /FO CSV | grep -i "NOTEPAD.EXE"
This returns a long string that contains the info I need:
Code:
File STDIN:
"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
eek(s)","Disabled","Disabled","Disabled","Disabled"
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?
Thanks!