I tried to schedule a task by
schtasks /create /tn Test /sc minute /mo 1 /tr "del /f \"%UserProfile%\path\file\""
...however the Scheduler always ends up with the following type of error:
Task Scheduler failed to launch action "del" in instance "{a6c5962d-ed1e-4917-9d43-07525dd03218}" of task "\Test". Additional Data: Error Value: 2147942402
The file in the path exists. I can run the same del
command from console and it deletes the file successfully, but I cannot make it work with scheduled task.
What I am doing wrong?