skafreak_510 0 Posted October 13, 2005 Share Posted October 13, 2005 I need to run 'Task Scheduled Task Wizard'. But I'm not sure how to write the run cammand. I need to schedule some scripts I wrote. If there is an easier way to do this or if you know of any scripts like the one I am trying to write it would help out. Any Ideas? Thanks Link to post Share on other sites
BigDod 521 Posted October 13, 2005 Share Posted October 13, 2005 I need to run 'Task Scheduled Task Wizard'. But I'm not sure how to write the run cammand. I need to schedule some scripts I wrote. If there is an easier way to do this or if you know of any scripts like the one I am trying to write it would help out. Any Ideas?ThanksIf you need to run some of your tasks at scheduled times you could compile them and just use the windows task scheduler. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to post Share on other sites
skafreak_510 0 Posted October 13, 2005 Author Share Posted October 13, 2005 thats what I have been doing but is there anyway to automate task scheduler I need to schedual task on a buch of comps rather often. Then all would have to do is add a file with a bunch of strings for the times I want it to set it up as. I have this command so far but it just opens the control panel. Run(@SystemDir & "\rundll32.exe" & " Shell32.dll,Control_RunDLL") Link to post Share on other sites
ChrisL 14 Posted October 13, 2005 Share Posted October 13, 2005 you could use the run @comspec function, and use each of these lines in dos one at as time. AT /DELETE /YES (deletes all previos schedules entered in dos) at 19:00 /interactive /every:m,t,w,th,f,s,su c:\batches\OnightQ.exe at 02:30 /interactive /every:su c:\batches\230am.bat at 04:00 /interactive /every:m,t,w,th,f,s,su c:\batches\4am.bat This is from a batch file we use at work [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to post Share on other sites
skafreak_510 0 Posted October 13, 2005 Author Share Posted October 13, 2005 (edited) you could use the run @comspec function, and use each of these lines in dos one at as time.AT /DELETE /YES (deletes all previos schedules entered in dos)at 19:00 /interactive /every:m,t,w,th,f,s,su c:\batches\OnightQ.exeat 02:30 /interactive /every:su c:\batches\230am.batat 04:00 /interactive /every:m,t,w,th,f,s,su c:\batches\4am.batThis is from a batch file we use at workThanks, but I'd prefer not to use dos. Edited October 13, 2005 by skafreak_510 Link to post Share on other sites
Valuater 138 Posted October 13, 2005 Share Posted October 13, 2005 this might help Run("mmc Services.msc -k netsvcs", @SystemDir) WinWaitActive("Services") Sleep(300) Send("{TAB}") Sleep(300) Send("Task Scheduler") Sleep(300) Send("{ENTER}") Sleep(300) Send("!e") Sleep(300) Send("A") Sleep(300) Send("!A") Sleep(300) Send("!S") Sleep(2000) MsgBox(64,"Finished Set-up"," If all settings are satisfactory... " & @CRLF & " Please press *OK* ") While 3 If Not WinExists("Task Scheduler Properties") Then ExitLoop Sleep(100) WEnd Sleep(100) WinClose("Services") 8) Link to post Share on other sites
herewasplato 3 Posted October 13, 2005 Share Posted October 13, 2005 (edited) I could not find a way to directly create a scheduled task... I could not find a way to directly open the Scheduled Task Wizard... What I could put together was this: Run("explorer ::{D6277990-4C6A-11CF-8D87-00AA0060F5BF}") WinWait("Scheduled Tasks") WinActivate("Scheduled Tasks") WinWaitActive("Scheduled Tasks") Send("{HOME}{ENTER}") WinWait("Scheduled Task Wizard") WinActivate("Scheduled Task Wizard") WinWaitActive("Scheduled Task Wizard") Send("!n")Hope it helps... Edit: I tested on XP with a scheduled task named aaa. "Add Sheduled Task" seems to always stay on top... ...so the {HOME} should always reach it. Edited October 13, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to post Share on other sites
skafreak_510 0 Posted October 13, 2005 Author Share Posted October 13, 2005 I could not find a way to directly create a scheduled task...I could not find a way to directly open the Scheduled Task Wizard...What I could put together was this:Run("explorer ::{D6277990-4C6A-11CF-8D87-00AA0060F5BF}") WinWait("Scheduled Tasks") WinActivate("Scheduled Tasks") WinWaitActive("Scheduled Tasks") Send("{HOME}{ENTER}") WinWait("Scheduled Task Wizard") WinActivate("Scheduled Task Wizard") WinWaitActive("Scheduled Task Wizard") Send("!n")Hope it helps...Edit: I tested on XP with a scheduled task named aaa."Add Sheduled Task" seems to always stay on top......so the {HOME} should always reach it.Thanks that helped a lot I will post my script in "Scripts & Scraps" when I finish. Link to post Share on other sites
LxP 7 Posted October 14, 2005 Share Posted October 14, 2005 Thanks, but I'd prefer not to use dos.Out of curiosity, could you please elaborate as to why you prefer actual window automation over a set of DOS calls? Relying on opening windows and sending keystrokes is nowhere near as dependable.You can hide the console window that appears if that's the problem. Link to post Share on other sites
bluebearr 1 Posted October 14, 2005 Share Posted October 14, 2005 (edited) Here are a couple of ideas:1. Microsoft has a Resource Kit utility that will allow you to schedule tasks. See this page:http://www.windowsitpro.com/Article/Articl...5148/45148.htmlThe FTP URL in the article for downloading the utility is still good.2. You can also use VBScript-WMI to schedule jobs. Here is a page with sample scripts:http://www.activexperts.com/activmonitor/w...taskscheduling/An issue with creating a task using the sample VBScript is that you cannot edit it using the Scheduled Tasks Control Panel (though you can delete it from there). It looks like the scripts mimic the AT command. Edited October 14, 2005 by bluebearr BlueBearrOddly enough, this is what I do for fun. Link to post Share on other sites
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now