Jump to content

UDF For Windows Task Schedulder


ken82m
 Share

Recommended Posts

I know this can be done with some command line stuff.

But I was just wondering if anyone has or knows of maybe a UDF for interacting with the task scheduler.

I searched the help file and forum but didn't come up with anything new.

Thanks,

Kenny

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

I know this can be done with some command line stuff.

But I was just wondering if anyone has or knows of maybe a UDF for interacting with the task scheduler.

I searched the help file and forum but didn't come up with anything new.

Thanks,

Kenny

If you have some time and you want to do this, you can write an UDF for Task Scheduler. :P

When the words fail... music speaks.

Link to comment
Share on other sites

lol thank you great one lol :P

I'll give it a try :(

Kenny

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Ok let me know if it works,things seemed fine here but I only have one comp to test on and what may work by fluke here might throw an error there >.>

Try not to die before you test it :P otherwise i'll have to say "oh my God! they killed kenny!" XD sorry.

Edit: face didn't show up >.>

Edited by dbzfanatic
Link to comment
Share on other sites

Killed me?! you got that right smoke started coming out of the computer when I hit run script lol :(

It worked like a charm thanks :P

I wish I understood COM, apperantly task scheduler has it's own interface you can use.

I found something in PERL but no help there lol

Kenny

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

OMG IT WORKED?! I'm glad it did, I've never written a UDF before so I'm really glad it worked. I don't really understand COM either but I'll look into it soon. Is there a link you can give me to the COM info?

Link to comment
Share on other sites

Here's a bunch of 1.0 examples on MSDN :P

There are 2 versions of the API apperantly.

ver. 2.0 only works on vista, ver. 1.0 works on previous versions and on vista.

http://msdn.microsoft.com/en-us/library/aa382078(VS.85).aspx

Here's a PERL utility I found, if someone understands it maybe they could convert it.

http://sourceforge.net/projects/taskscheduler/

-Kenny

Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Well I see the link for the perl script and I checked MSDN but it doesn't seem to have any info I can use (maybe I'm just not looking in the right place(s) but I couldn't find anything).

Link to comment
Share on other sites

would have been nice if I gave you the link lol

I added it above (http://msdn.microsoft.com/en-us/library/aa382078(VS.85).aspx)

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Well I found that already but it didn't show me the object I needed to get or create,just action. I was informed about this http://www.microsoft.com/technet/scriptcen...04/hey0922.mspx in my UDF thread in the example scripts forum. I think I've found what I need to do but that remains to be seen. I also updated my UDF with a standard version (capable of being submitted if someone thinks it's good enough, I personally don't right now but I also don't know the user base that this UDF could/would have so if enough people want/need it I won't stop someone from submitting it) so it's a bit more readable and easier to understand from the function headers.

Link to comment
Share on other sites

  • 6 months later...

hi, how can i create a task scheduler with autoit?

Simply put, how can I run the task scheduler with autoit?

What I know that i can run it by

Run(@comspec & " /c Start %SystemRoot%\explorer.exe ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\::{D6277990-4C6A-11CF-8D87-00AA0060F5BF}")

but I want it to open it directly to create a task.

Link to comment
Share on other sites

shell.open will openthe folder with the guid u entered

and MS posts this WMI example which can be easily traqnslated to autoit..

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create _
    ("Cleanup.exe", "********123000.000000-420", _
        True , 1 OR 4 OR 16, , , JobID) 
Wscript.Echo errJobCreated
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...