Forum Discussion

tom2025's avatar
tom2025
Copper Contributor
Mar 13, 2025

schtasks help

Hello,

I would like to create the following Scheduled Task via script:

schtasks /Create /RU User /RP Password /SC ONLOGON /TN “Task” /TR “C:\Temp\Programm.exe” /RL HIGHEST /DELAY 0001:00


2 questions:


1) Which switch do I need so that afterwards, under Properties, General, “Only execute if the user is logged on” is checked?

Now the task is created with “Execute regardless of user login”.


2) Which switch can I use to ensure that, for example, Repeat: every hour - for the duration of: 1 day, is entered (Properties, Trigger).

I have already used it with the switch /RI, but the error is displayed on execution, does not work with /SC ONLOGON and is also in the help !??

But if I go to the settings, I can change this manually.....

No RepliesBe the first to reply

Resources