Windows 7 Scheduling a Batch File to Run on Windows 7 When the PC Starts Up

Billd59

New Member
Joined
Jun 22, 2012
Messages
38
I have windows 7 home Preium. I have a batch file I am trying to schedule. Can schedule It to run when the PC Is shut off? Or If the PC Is off at the schedule time and than you turn It on I would like the batch to run. I been trying to fiure It out. I can get It to run It the computer Is on and It can be any user logged on. I just wouldlike to know If they turn It off I want It to run when they log on. Can someone help? I am just learning batch file and how to schedule. I never schedule before.
 

Solution
Scheduling a batch file to run on a specific condition in Windows 7 can be achieved using Task Scheduler. Here's a guide on how you can schedule your batch file to run in the scenarios you described:

Scenario 1: Run Batch File When PC Is Shut Down​

  1. Open Task Scheduler:
    • Press Windows Key + R, type taskschd.msc, and hit Enter.
    []Create a Basic Task:
    • Click on "Create Basic Task" on the right-hand side.
    [
    ]Name and Describe the Task:
    • Give your task a name and description to help you identify it.
    []Set Trigger:
    • Select "When a specific event is logged" as the trigger.
    • Set the appropriate log and source details (for shutdown...
Scheduling a batch file to run on a specific condition in Windows 7 can be achieved using Task Scheduler. Here's a guide on how you can schedule your batch file to run in the scenarios you described:

Scenario 1: Run Batch File When PC Is Shut Down​

  1. Open Task Scheduler:
    • Press Windows Key + R, type taskschd.msc, and hit Enter.
    []Create a Basic Task:
    • Click on "Create Basic Task" on the right-hand side.
    [
    ]Name and Describe the Task:
    • Give your task a name and description to help you identify it.
    []Set Trigger:
    • Select "When a specific event is logged" as the trigger.
    • Set the appropriate log and source details (for shutdown events).
    • You can choose an event ID for system shutdown.
    [
    ]Set Action:
    • Select "Start a program" as the action.
    • Choose your batch file as the program to start.
    []Finish:
    • Review your settings and finish the task creation process.

      Scenario 2: Run Batch File When PC Is Turned On After Scheduled Time​

    [
    ]Open Task Scheduler (as detailed above). []Create a Basic Task (as detailed above). []Set Trigger:
    • Select "At startup" as the trigger.
    []Set Action (as detailed above). []Finish (as detailed above).

    Note:​

    • Depending on your setup, the user account under which the task runs may affect its functionality.
    • Make sure the batch file path is correct in the Task Scheduler setup.
    By following these steps and adjusting the trigger conditions as needed, you can schedule your batch file to run when the PC is shut down or when it is turned on after a scheduled time. This way, you can automate your tasks efficiently. If you encounter any issues during the setup, feel free to ask for further assistance!
 

Solution
Back
Top