Marco wrote: However, be ready to spend a considerable amount of time debugging your Run command to get the correct magical incantation of correctly escaped quotes. (I've attempted it and failed thus far.)
Have you tried heredoc?
I did not, and I quit playing with this after posting.
It's a problem of all the places that are caring about quotes and spaces there.
1) XY in the run command's arguments.
2) schtasks in /TR's additional parameter.
3) XY in the /script= parameter.
I think the easiest thing to do would be to have the original script write a batch file that opens XY with the secondary script and then run schtasks and use that batch file as the /TR parameter.
And maybe even have that secondary script be a script file itself to simplify what is being passed into XY on the command line.
-----
Another alternative is to just write a simple script that executes commands found in an INI file or something and create a scheduled task to run it in XY every n minutes.
Then the original script could "register" it's secondary script with the recurring script and it would be run whenever the scheduled task next ran the recurring script.
-----
All of this said...
Truth be told I'm leary of using XY scripting with scheduled tasks as I once had a task set up to run the following periodically:
Code: Select all
XYplorer.exe /script="::SaveSettings;"
I came back after a long weekend to find my machine nearly unresponsive due to the many hundred instances of xyplorer.exe that were running.
I'm not sure what the failure was, or if anyone but myself was to blame, but that was the end of that experiment for me.
