Talk:Scheduled Tasks: Difference between revisions
No edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
Also when I try the code the popup says error but the task is installed. | Also when I try the code the popup says error but the task is installed. | ||
How do a create a task that runs every hr every day. I have tried adjusting 11 and 12 but its ignored. | How do a create a task that runs every hr every day. I have tried adjusting 11 and 12 but its ignored. | ||
== Alternative to this function: schtask.exe + ExecWait == | |||
As this function is a real pain to use (I could not make it work in my script), I suggest anyone to use instead the schtask.exe command-line with the <code>[[Reference/ExecWait|ExecWait]]</code> macro to create a scheduled task. Since Windows Vista, you can even import xml files through the <code>/xml</code> flag, you could ship a MyTask.xml file inside your installer, extract to the <code>[[Reference/$PLUGINSDIR|$PLUGINSDIR]]</code> dir previously created by the <code>[[Reference/InitPluginsDir|InitPluginsDir]]</code> macro, modify its content as seen in [[A sample script that uses several cool functions (replace txt, mutually exclusive functions, MUI, patch install, etc.)|this article]] and call <code>ExecWait "schtasks /create /xml $PLUGINSDIR\MyTask.xml /tn $\"MyTask$\" /f"</code> to finally create your task. | |||
To obtain your xml, just create your task through the schtask.msc utility and export it through the appropriate menu. To confirm that the task was successfully created you should check its return code ($0). | |||
<br>-- [[User:Bugmenot|Bugmenot]] ([[User talk:Bugmenot|talk]]) 17:15, 1 September 2015 (UTC) | |||
: I advised in my previous comment to use the 'search and replace' function taken from [[A sample script that uses several cool functions (replace txt, mutually exclusive functions, MUI, patch install, etc.)|this article]], in fact you should not use any of the [[:Category:Text Files Manipulation Functions|Text Files Manipulation Functions]] but the awesome [[TextReplace plugin]] instead that seems much more reliable and easier to use.<br>-- [[User:Bugmenot|Bugmenot]] ([[User talk:Bugmenot|talk]]) 15:39, 8 January 2016 (UTC) |
Latest revision as of 15:39, 8 January 2016
how hard would it be to do a deleteTask function? any help is appreciated
The article has been edited to show how to do this now.
All I see is a edit to remove the task before creating it.
How do you add a option to the uninstaller to erase a task.?
Need sample uninstall code.
Also when I try the code the popup says error but the task is installed. How do a create a task that runs every hr every day. I have tried adjusting 11 and 12 but its ignored.
Alternative to this function: schtask.exe + ExecWait
As this function is a real pain to use (I could not make it work in my script), I suggest anyone to use instead the schtask.exe command-line with the ExecWait
macro to create a scheduled task. Since Windows Vista, you can even import xml files through the /xml
flag, you could ship a MyTask.xml file inside your installer, extract to the $PLUGINSDIR
dir previously created by the InitPluginsDir
macro, modify its content as seen in this article and call ExecWait "schtasks /create /xml $PLUGINSDIR\MyTask.xml /tn $\"MyTask$\" /f"
to finally create your task.
To obtain your xml, just create your task through the schtask.msc utility and export it through the appropriate menu. To confirm that the task was successfully created you should check its return code ($0).
-- Bugmenot (talk) 17:15, 1 September 2015 (UTC)
- I advised in my previous comment to use the 'search and replace' function taken from this article, in fact you should not use any of the Text Files Manipulation Functions but the awesome TextReplace plugin instead that seems much more reliable and easier to use.
-- Bugmenot (talk) 15:39, 8 January 2016 (UTC)