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
Previous Post

Powering Up with PowerShell: A Comprehensive Guide

Next Post

Use PowerShell to remote install software

Related Posts

How to Reserve IP Address on Windows Server DHCP?

DHCP reservation is the creation of a special entry on the DHCP server. Thanks to this, the same IP address from the DHCP scope address pool will be issued for a specific device (MAC address). In this article, we’ll look at how to create and manage reservations on a DHCP server running Windows Server 2019.
Read More

How to Set Proxy Settings via Group Policy?

The article shows how to use Active Directory Group Policies (GPOs) to configure proxy server settings on domain-joined computers running Windows 10/11 and Windows Server 2022/2019/2016/2012R2. These proxy server settings are used by all modern browsers, including Internet Explorer 11 (reached end of support on June 2022), Google Chrome, Microsoft Edge, Opera, and Mozilla Firefox
Read More