Bird
0
0

You want to schedule a PowerShell script to run every Monday and Friday at 6 PM. Which schtasks command correctly sets this up?

hard📝 Application Q15 of 15
PowerShell - Automation Patterns
You want to schedule a PowerShell script to run every Monday and Friday at 6 PM. Which schtasks command correctly sets this up?
Aschtasks /create /tn "WeeklyTask" /tr "powershell.exe -File C:\Scripts\weekly.ps1" /sc weekly /d MON,FRI /st 18:00
Bschtasks /create /tn "WeeklyTask" /tr "powershell.exe -File C:\Scripts\weekly.ps1" /sc daily /d MON,FRI /st 18:00
Cschtasks /create /tn "WeeklyTask" /tr "powershell.exe -File C:\Scripts\weekly.ps1" /sc weekly /d 1,5 /st 18:00
Dschtasks /create /tn "WeeklyTask" /tr "powershell.exe -File C:\Scripts\weekly.ps1" /sc monthly /d MON,FRI /st 18:00
Step-by-Step Solution
Solution:
  1. Step 1: Choose correct schedule type for specific weekdays

    The /sc weekly option schedules tasks weekly on specified days.
  2. Step 2: Specify days and time correctly

    Use /d MON,FRI to run on Monday and Friday, and /st 18:00 for 6 PM start time.
  3. Final Answer:

    schtasks /create /tn "WeeklyTask" /tr "powershell.exe -File C:\Scripts\weekly.ps1" /sc weekly /d MON,FRI /st 18:00 -> Option A
  4. Quick Check:

    Weekly schedule with MON,FRI days and 18:00 time [OK]
Quick Trick: Use /sc weekly with /d MON,FRI for specific weekdays [OK]
Common Mistakes:
  • Using /sc daily instead of weekly for specific days
  • Using numeric days instead of MON,FRI
  • Choosing monthly schedule incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes