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

Auto Run PowerShell Script with Task Scheduler

Automation is king in today’s dynamic IT environments. Running PowerShell scripts with Task Scheduler is a vital skill set, particularly beneficial for system administrators to automate repetitive tasks and bolster efficiency with Windows Servers and clients. What is Task Scheduler? Task Scheduler is a built-in tool within the Microsoft Windows environment designed to simplify the
Read More

Installing Software (MSI Packages) Using Group Policy

In this article, we will show how to install software on user computers in an Active Directory domain using GPO.The built-in Windows GPO features allow you to deploy programs that are only distributed as MSI or ZAP packages. Other types of apps you will have to install in alternative ways: using SCCM, via GPO logon
Read More