[Win32utils-devel] Implementing a TaskScheduler#exists? method

Heesob Park phasis at gmail.com
Tue Jun 16 21:46:57 EDT 2009


Hi,

2009/6/17 Daniel Berger <djberg96 at gmail.com>:
> Hi,
>
> I'd like to add TaskScheduler#exists?(work_item) to the win32-taskscheduler
> library. Mostly I want it for testing, but it might come in handy for other
> people as well.
>
> What's the best way to approach this? Just enumerate the tasks, and check
> for the name?
>
I think the best way to check taskscheduler item is just go to the
Scheduled Tasks folder (in most case c:\winodws\tasks) and see the
.job files.

You can write it with ruby like this:

def TaskScheduler#exists?(work_item)
  File.exist?("#{ENV['windir']}\\Tasks\\#{work_item}.job")
end

BTW, Do you mind I write pure ruby taskscheduler?

Regards,

Park Heesob


More information about the win32utils-devel mailing list