gilk Posted February 13, 2005 Posted February 13, 2005 Hello fellow AutoITersIve been trying to automate the creation of a scheduled task..To do that I want to verify that the task doesnt already exist,So I tried searching the list of scheduled tasks with the following:$exist=ControlCommand("Scheduled Tasks","","SysListView321", "FindString", "My Task")sleep(1000)MsgBox ( 1, "kuku", $exist ,10 )But no matter if the task exists or not and where it is in the list of tasks, the returned value is always 1Ideas anyone ?gilk
JerryD Posted February 13, 2005 Posted February 13, 2005 Not exactly the answer you're looking for, but under XP (and I assume 2k3), you could use the command line utility SCHTASKS. Win2K and above also has the AT command, but it's no where near as powerful. Check (gasp) XP's HELP for details on SCHTASKS or simply type SCHTASKS at a command line.
gilk Posted February 13, 2005 Author Posted February 13, 2005 Not exactly the answer you're looking for, but under XP (and I assume 2k3), you could use the command line utility SCHTASKS. Win2K and above also has the AT command, but it's no where near as powerful. Check (gasp) XP's HELP for details on SCHTASKS or simply type SCHTASKS at a command line.<{POST_SNAPBACK}>Thanks for the advice but I'm working with a Win2K network (800 clients) and the AT command is not strong enough for the required optionsgilk
JerryD Posted June 9, 2005 Posted June 9, 2005 Thanks for the advice but I'm working with a Win2K network (800 clients) and the AT command is not strong enough for the required optionsgilk<{POST_SNAPBACK}>If you're running from an XP (or I assume it's available on a Win2k3 server too), you can use schtasks to query a remote Win2k computer:schtasks /query /S remotecomputer /U user /P passwordwhere user and password are the user ID and password for the remote computer with sufficient rights to perform the operation if needed.The output would be something like this (and could be redirected to a text file for reading):TaskName Next Run Time Status======== ============ ===============Task1 At system start upTask2 At logon timeTask3 Never Could not startand possibly even use it to create the task if needed. See XP/2K3 help for details.Also, tasks are saved as .job files under @WindowsDir\Tasks, so from the list above you'd have:@WindowsDir\Tasks\Task1.job@WindowsDir\Tasks\Task2.job@WindowsDir\Tasks\Task3.jobIf you're unsure of what the windows directory is on a remote computer, you can read it from its registry with:RegRead ( '\\remotecomputer\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'SystemRoot' )Unfortunately, you can't just copy a .job file to the remote computer - it looses it's security info.JerryD
gilk Posted June 9, 2005 Author Posted June 9, 2005 Thanks, I'll try that' and anyway it opens up a lot of new optios gilk
TuMbLeWeEd Posted June 9, 2005 Posted June 9, 2005 Hello fellow AutoITersIve been trying to automate the creation of a scheduled task..To do that I want to verify that the task doesnt already exist,So I tried searching the list of scheduled tasks with the following:But no matter if the task exists or not and where it is in the list of tasks, the returned value is always 1Ideas anyone ?gilk<{POST_SNAPBACK}>You should use the ControlListView ( "Scheduled Tasks", "", "Syslistview321", "FindItem", "My Task" )command for that My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers
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