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.

Total
0
Shares
Leave a Reply

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

Previous Post

Powering Up with PowerShell: A Comprehensive Guide

Next Post

Use PowerShell to remote install software

Related Posts

How To Fix Error: There are Currently No Logon Servers Available

When a user logs on to a Windows computer that is joined to an Active Directory domain, they may see the following error message:There are currently no logon servers available to service the logon request.This message says that none of the AD domain controllers (LogonServer) is available from this computer to authenticate the user. The
Read More