Auto Shutdown cmd Script

Auto Shutdown cmd Script

Here’s a sample batch script that you can use to automatically shutdown a computer at 11:03pm every day and display a 60-second countdown before shutting down:


					
				

Save the above code in a text file with the extension “.bat” (e.g. “shutdown.bat”).

To schedule this batch script to run automatically at 11:03pm every day, you can use the Windows Task Scheduler:

    1. Press the Windows key + R to open the Run dialog box.
    1. Type “taskschd.msc” and press Enter to open the Task Scheduler.
    1. Click “Create Task” in the right-hand pane.
    1. In the “General” tab, give the task a name (e.g. “Automatic Shutdown”), select “Run whether user is logged on or not”, and check “Run with highest privileges”.
    1. In the “Triggers” tab, click “New” and set the trigger to “Daily” and “Recur every 1 days”, and set the start time to 11:03pm.
    1. In the “Actions” tab, click “New” and select “Start a program”. Browse to the location of the batch script you created and select it.
    1. Click “OK” to save the task.

That’s it! The batch script will run automatically at 11:03pm every day and display a 60-second countdown before shutting down the computer, even if a user is logged on. The “/f” parameter in the “shutdown” command ensures that the shutdown is forced, which means any open programs or unsaved data will be lost. Be sure to save any important work before the shutdown occurs.

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *