I'm having trouble getting schtasks.exe to create a Sheduled task that will:
Start at logon Repeat at minute intervals I've tried the following:
schtasks /Create /SC MINUTE /MO 1 /TR "C:\windows\system32\calc.exe" /TN "Run Doo Dad" /RU "user" /RP "secret" /F
Which creates a task that starts one minute after it's created and will repeat, but does not successfully start again after a reboot. This appears to create a "One Time" trigger, which is of dubious usefulness, but is apparently part of the design.
When I attempt to use "/SC ONLOGON" (while supplying /RU and /RP), I am rewarded with "Error: access is denied." Even if I were to be granted access, The Famous Manual (https://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29.aspx) says that the ONLOGON event cannot have modifiers, and it is unclear how one actually specifies repeating tasks for ONLOGON with the command line.
I am quite near to losing my mind, here. I'm coming from a unix background, and am wistfully dreaming of the simplicity of cron.
The answers "Just Do it in the GUI" or "Create an XML File" are not acceptable in our situation. I might be amenable to "Do it with pywin32" but the only examples I saw are limited in almost exactly the same way,and I can't find proper documentation anyway.
I don't know enough about powershell to know where to begin, but I'm amenable to learning.
Any suggestions appreciated.