How do I pass parameters to a scheduled task?
Asked
Active
Viewed 9,769 times
1 Answers
4
Add the parameters to the end of the Run textbox in Properties

SLaks
- 868,454
- 176
- 1,908
- 1,964
-
What if the parameters are variable? – Bryce Guinta Aug 08 '17 at 17:00
-
1@BryceGuinta: What do you mean? – SLaks Aug 10 '17 at 13:41
-
I only know what I want to pass into the task right before I call the task and the value changes each time – Bryce Guinta Aug 10 '17 at 13:43
-
1@BryceGuinta: Then you need to write a program or batch file to compute them. – SLaks Aug 10 '17 at 15:26
-
Right, I'm calling schtasks in a batch file. However the only way ive figured out how to pass data from the batch file to the task is to store the bash variable into a known file path and then have the task script to read that file – Bryce Guinta Aug 10 '17 at 21:02
-
1@BryceGuinta: Why can't you make the task run a batch file that computes the data directly? – SLaks Aug 10 '17 at 21:18
-
The calling batch file is a an event (post commit-hook) which shouldn't have blocking operations. Svn doesn't give me a choice of a task – Bryce Guinta Aug 10 '17 at 21:22
-
1@BryceGuinta: Then you can embed your parameter values directly in the command-line that you pass to `schtasks`. – SLaks Aug 10 '17 at 21:34
-
That is my problem. `schtasks` doesn't have a way to pass arbitrary arguments to the task from the command-line. – Bryce Guinta Aug 10 '17 at 23:18
-
That link is only for creating a task on the command-line. I would have to create a new task each time I wanted to run the script, which doesn't make much sense (might as well use a function). It looks like there is no direct way to feed changing arguments into a task without creating a new task. – Bryce Guinta Aug 11 '17 at 16:32