3 ms·
The Windows Task Scheduler is probably the way to go. You can create tasks that run on a variety of schedules or events. They can run a script that does what yo
by cshokie 4y ago
The Windows Task Scheduler is probably the way to go. You can create tasks that run on a variety of schedules or events. They can run a script that does what you need.
There is a PowerShell module for managing scheduled tasks. It should be possible to write a script that will create the appropriate scheduled tasks on behalf of the non-proficient user. They just need to run the PowerShell script once to get things going.
- coderintherye 4y agoThanks, but is there a way to do that without having access to the computer or having to try to walk the user through setting up a task in task scheduler? The users in this use case can do something as simple as download and install a .exe program, but there is no way they would manage setting something up in Task Scheduler. I've used Task Scheduler via remote desktop (which itself was a pain to get them able to set up) to set things up for them before but that is not scalable.
- cshokie 4y agoYes that is what the PowerShell module is for. You can script things like ‘New-ScheduledTask’ and give it the appropriate parameters. The only thing the user would need to do is run the script. That could create the scheduled tasks and drop the “real” scripts where the scheduled tasks can find them. It can be helpful to send along a tuple of {PowerShell, cmd} where cmd just forwards arguments to PowerShell. That way you can run “PowerShell -ExecutionPolicy Bypass myscript.ps1 %*” and avoid the pain of changing the system-wide security policy for PowerShell scripts. (Unsigned PowerShell scripts are blocked by default).