Bird
0
0

You wrote this command to create a scheduled task:

medium📝 Debug Q7 of 15
PowerShell - Automation Patterns
You wrote this command to create a scheduled task:
schtasks /create /tn "MyTask" /tr "powershell.exe -File C:\Scripts\myscript.ps1" /sc daily /st 25:00

Why does the task fail to create?
AThe /sc daily parameter is missing.
BThe script path is incorrect because of double backslashes.
CThe task name "MyTask" is too short.
DThe start time 25:00 is invalid; hours must be between 00 and 23.
Step-by-Step Solution
Solution:
  1. Step 1: Check start time format

    Time must be in 24-hour format between 00:00 and 23:59; 25:00 is invalid.
  2. Step 2: Validate other parameters

    Double backslashes are correct in Windows paths; task name length is fine; /sc daily is present.
  3. Final Answer:

    The start time 25:00 is invalid; hours must be between 00 and 23. -> Option D
  4. Quick Check:

    Invalid time format [OK]
Quick Trick: Use valid 24-hour time (00-23) for /st parameter [OK]
Common Mistakes:
  • Using invalid hour values like 25
  • Thinking double backslashes cause errors
  • Assuming task name length matters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes