Bird
0
0

Which of the following is the correct syntax to create a scheduled task that runs a PowerShell script daily at 7 AM using schtasks?

easy📝 Syntax Q12 of 15
PowerShell - Automation Patterns
Which of the following is the correct syntax to create a scheduled task that runs a PowerShell script daily at 7 AM using schtasks?
Aschtasks /create /tn "MyTask" /tr "powershell.exe -File C:\Scripts\task.ps1" /sc daily /st 07:00
Bschtasks /run /tn "MyTask" /tr "powershell.exe -File C:\Scripts\task.ps1" /sc daily /st 07:00
Cschtasks /delete /tn "MyTask" /tr "powershell.exe -File C:\Scripts\task.ps1" /sc daily /st 07:00
Dschtasks /create /tn "MyTask" /tr "C:\Scripts\task.ps1" /sc hourly /st 07:00
Step-by-Step Solution
Solution:
  1. Step 1: Identify the command to create a task

    The /create option is used to create a new scheduled task.
  2. Step 2: Check the task action and schedule

    The task runs PowerShell with the script file path, scheduled daily at 07:00.
  3. Final Answer:

    schtasks /create /tn "MyTask" /tr "powershell.exe -File C:\Scripts\task.ps1" /sc daily /st 07:00 -> Option A
  4. Quick Check:

    Use /create with /tn, /tr, /sc daily, /st 07:00 [OK]
Quick Trick: Use /create to schedule, not /run or /delete [OK]
Common Mistakes:
  • Using /run instead of /create to schedule
  • Omitting powershell.exe in /tr argument
  • Wrong schedule type like hourly instead of daily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes