How to set up smartphones and PCs. Informational portal
  • home
  • Windows 10
  • How to make the computer shut down after a certain time. How to shut down your computer at a specified time

How to make the computer shut down after a certain time. How to shut down your computer at a specified time

Perhaps many of the users of stationary personal computers wondered how to organize automatic switching on and computer shutdown at a specified time or on a schedule. In this article, we will look at one of the more affordable ways.

To implement this function of a personal computer, we will use exclusively the built-in capabilities of the BIOS input-output system and the Microsoft Windows 7 operating system. The use of third-party software is excluded by itself.

Let us define a schedule that consists of the necessary conditions, i.e. we want the personal computer to turn on every weekday at 07:00 am and turn off at 17:00 pm. Regarding weekends, due to a limitation in the BIOS input / output system, the computer will start at 07:00 in the morning and turn off after 10 minutes as unnecessary. the workplace is empty.

So, let's begin. When you turn on the computer, you need to enter the BIOS input / output system. To do this, press the key DELETE, this key is mainly used in many motherboards, but there are still other options for using the keys, such as:

Esc F1 F2 F3 F10 F11 F12

After pressing the DEL key, the system BIOS menu will be displayed and will look something like the following figure:

We set the value of the parameter "Resume by Alarm" to, activating the turning on of the computer according to the schedule. In the "x Date (of Month) Alarm" parameter, you can select the daily execution or define the desired day of the month, in our case we will use the first one - Everyday. The computer start-up time "x Time (hh: mm: ss) Alarm" is set at 07:00 am.

Thus, automatic switching on personal computer organized according to the schedule: daily switching on at 07:00 in the morning, both on weekdays and weekends.

Computer auto shutdown settings

Now we need to create a schedule for automatic shutdown personal computer... The built-in console file will help us with this. taskschd.msc, the so-called "Task Scheduler", which will perfectly cope with the task. Task Scheduler can be launched using the Find Programs and Files line and Windows Explorer.

Method 1 - "Find programs and files"

Method 2 - "Explorer"

After the above commands, the "Task Scheduler" will open, in which you need to go to the "Task Scheduler Library" item and take the action to create a task - "Create a task" or "Create a simple task", as you like. We will not describe a detailed description of creating a task, everything is available and written in Russian.

As you can see, in the figure below, two tasks have been created that produce automatic shutdown personal computer... The first task, called "OFF PC", organizes the shutdown of the PC on weekdays at 17:00, and the second task, called "OFF PC Weekend", turns off the PC on weekends 10 minutes after turning on the PC.

A detailed description of creating a task is missing, but you need to know the following that for automatic shutdown of the computer you need to use the launch of the program shutdown.exe –s in every task.

And also in the "General" tab for both tasks there are rules for performing the task only for the registered user, see below.

The created tasks will not function if you do not create automatic user authorization in the system, i.e. when the computer starts and boots, the login will not be performed, since you need to enter the password to login, and this is due to our created tasks.

Therefore, to enter the "User Accounts" and set a password for automatic login without a visible password prompt, you must open the explorer and specify "Control userpasswords2" or "Netplwiz", not for everybody.

Here we are done setting up automatic switching on and disconnections personal computer using the built-in BIOS functions and Windows 7. Try it YOURSELF!

Turning off the computer after a certain time, set by a person, can be very convenient in many cases. For example, with this feature, you no longer have to wait for the computer to finish running processes, such as downloading or processing videos, to turn it off. Instead, you can set a timer and leave work or go to bed. There are many ways to set a timer:

  • via the command line;
  • using the task scheduler;
  • with third-party utilities.

Command Prompt is available on most Windows operating systems. It is used to execute human-entered commands. Most of them are used to automate tasks with scripts and batch files, perform advanced administrative functions, troubleshoot and solve specific problems in Windows.

Step 1. Run Command Prompt. Click on the "Start" button and enter "Command Prompt" or "cmd" in the search bar. Run it as administrator by right-clicking on the application and selecting this mode.

Step 2. Enter "shutdown -s" at the command line. This command will shutdown your computer within a minute after issuing the command.

Enter "shutdown -s"

Clarification of the task:

  1. If you want to shutdown the computer immediately, enter "shutdown -s -t 00" instead.
  2. To shutdown the computer after a specified time, enter "shutdown -s -t ##", where "##" is the number of seconds (for example, "06" after six seconds, "60" after a minute, etc.) ...

Step 3. Press "Enter", this will start the execution of the task.

Press "Enter" to start the task

You will now see a confirmation of the task on the screen. It will no longer be possible to undo the action. You also won't see the countdown on your screen.

This method is suitable for one-time use, but may be inconvenient for continuous use. In this case, the task scheduler will come to the rescue.

Shutting Down Your Computer Using Task Scheduler

Task Scheduler is a standard Windows component that allows predefined actions to be automatically performed whenever a specific set of conditions are met. For example, you can schedule a task to run a backup every night, or turn off your computer after a specific time.

Step 1. Use the search bar on the Start menu to find Task Scheduler.

In the "Start" menu we find "Task Scheduler"

Step 2. Run the program. A window with many sections will open in front of you.

Run the program and click "Create task"

Step 3. From the menu on the right, select Create Task. Give it a name and describe the action. Then move on to the next step. The Triggers section can be skipped without prejudice to the task.

The "Triggers" section can be skipped without prejudice to the task

Step 3. Go to the "Actions" section. Create an action by typing "C: windowssystem32shutdown.exe" in the script line. Click on the "OK" button.

Create the required action and click "OK"

Step 4. Now let's move on to the conditions that are required to perform the action. For example, let's set a condition - computer inactivity for 1 hour. This means that if the computer is not used in any way for 60 minutes, it will turn off automatically.

After you click "OK", the task creation window will close, the new task will be active. You can find it in the task library. It contains absolutely all tasks that are created by the user or programs installed on the computer.

Video - How to Shut Down Your Computer at a Specified Time

Disconnection using third-party programs

The above methods are used to disable the built-in utilities. Using them is not as easy as we would like. For those who would like to simplify their task, many simple programs have been created that are very convenient.

Turn off timer

The Shutdown Timer is an easy-to-use software that allows users to set the shutdown time for their computer. The main advantage of this program is that there is no need to download the entire software package. Moreover, in addition to shutdown, you can set a timer for reboot. Of course, it also has disadvantages, for example, limited functions in the free version and the interface in English.

This program works entirely through the cloud. Everything is configured through the browser, on the official developer page. The user simply goes to the official page and then sets the desired time. It is currently designed for Windows XP, although newer versions are also compatible with the service.

Step 1. Download the program and install it on your computer.

Note! The program may require Java to be installed if it is not present on your computer. Follow the guidelines that you see on your screen.

Step 2. When the installation is complete, a small window will appear on your screen with several understandable elements.

Set the time and click "Start"

The first field is for hours, the second is for minutes, and the third, respectively, is for seconds. This is the time after which the program will perform one of the two available actions:

  • shutdown when Shutdown is selected;

Now all that remains is to click on the "Start" button to start the timer.

The PC Auto Shutdown Timer is useful to all users. Watching a movie before going to bed, going away for a while, leaving the computer to download files or save a project - this is not a complete list of tasks, after which you can automatically turn off the computer using a timer. Such timers can be either standard or created by third-party developers specifically for windows 7.

See also: Download computer shutdown timer

Using the standard timer to turn off the PC

In order to automatically set the time for shutting down the computer, you should follow these steps:

  • We press "Win + R" and enter the command "shutdown -s -t N", where instead of "N" we enter the shutdown time of the device in seconds.

  • After you click "OK", a notification will appear on the taskbar that the session will be terminated after the specified time.

  • If you want to cancel the command, enter in the Run line "shutdown -a".

You can also set the automatic shutdown of the PC using the .bat file. To create it, we perform the following steps:

  • Open notepad and enter the following command:

echo off cls set / p timer_off = "Vvedite vremya v sekundah:"

shutdown -s -t% timer_off%

  • Next, you need to save the file and assign the .bat extension to it. You can set any name for the file. However, in the "Type" field, you should select "All files".

  • After starting the .bat file, a command line will start, in which you need to specify the time for automatic shutdown of the device in seconds.

  • For example, you can specify 1800 (30 minutes) or 3600 (1 hour).

You can also automatically turn off your PC or laptop through the Windows Task Scheduler. To launch and configure it, we perform the following actions:

  • Press "Win + R" and enter "msc".

  • Here, in the right menu, you need to click "Create a simple task".

  • We set any name for the task and click "Next".

  • Since we are creating a "timer", the next step is to check the "Once" checkbox.

  • Next, we indicate the time when the PC needs to be turned off.

  • In the next window, click "Run the program".

  • In the window "Program or script" write "shutdown", and in the argument - "-s".

  • After you save the task, the computer will be turned off at the specified time.

Timers to automatically shutdown your computer

There are many programs on the Internet that allow you to turn off your PC automatically. Let's take a look at the most popular and easy-to-use ones.

OFF timer is a very simple and straightforward program that works for free and allows you to turn off your PC remotely. The principle of its use is as follows.

Run the exe.file and enter the time after which you need to shut down in windows 7. Click "Enable timer".

The program does not require installation, and therefore does not take up free space.

The computer shutdown timer is also a simple and understandable program in Russian. To use this program, you need to remove the Setup.exe file from the archive and start the installation.

We choose a place to install the program and follow the prompts.

After installation, a small window will start. Enter the shutdown time in windows 7 and click "Start".

The computer will turn off at the specified time.

PowerOff is a convenient software not only for automatically shutting down a laptop and stationary PC, but also for rebooting the system, entering hibernation mode. The principle of its operation is as follows:

  • Run the exe file from the archive. No installation required.
  • A large window will appear with many sections. We don't need all of them. We put a mark "Response time" and indicate the time. Next, select the action: shutdown, reboot, hibernation, etc. In the action field, select "By timer".

  • It is also worth putting down the date and setting the countdown time.

  • The PC will turn off after the specified time.

SoftikBox.com

Automatic shutdown of the computer.

In various cases, it becomes possible to turn off the computer at a specified time. For example, in the evening before going to bed while watching a movie, automatically turning off your computer will help you not to worry about it if you fall asleep.

Setting up the automatic shutdown of the computer is very simple, moreover, everything can be done using standard windows tools, using the Task Scheduler, or in some other ways, which we will consider below.

The Task Scheduler is located in the Administrative Tools section of the Control Panel. Run it and create a simple task. Following the instructions of the wizard for creating tasks, specify the name of the task, select the frequency of the task launch, for example, daily. Next, you should specify the time and day from which our task of shutting down the computer will be performed. In the "Action" section, select an action for the "Run the program" task. At the next step, you will need to specify the program to run, or rather the script (command) to shutdown the computer. On the Program or Script line, enter SHUTDOWN, and on the Add Arguments (Optional) line: -s –f. At the last stage, the wizard will offer to check all the parameters of the task being created, and if everything is correct, then finish the creation by clicking the "Finish" button. The images below show the steps in order.

You can also configure the automatic shutdown of the computer using the command line. This method is, of course, much easier, though if you have ever worked with the command line. To do this, go to the menu (Start - All Programs - Accessories - Command Line) and write the command "shutdown /?" and press the Enter key.

After that, the parameters of our utility will appear in the command line window. In this window, we are interested in the main three parameters that are shown in the image.

What do we have and how do we use these commands?

To, for example, turn off the computer after 2 hours, we need to register the command like this (shutdown -s -t 7200), and then press the Enter key. To set the desired time, we need to convert the hours and minutes into seconds. 7200 seconds equals 2 hours.

To cancel the specified shutdown of the computer, we need to enter the "shutdown" command with the -a option. That is, we enter "shutdown -a" like this.

Also, this action can be done through the "Run" command. The image shows where this item is located.

To cancel the task, write in the same way as in the command line "shutdown -a"

Now you know how to create an automatic computer shutdown. In conclusion, I would like to say that some programs have the ability to automatically shutdown the computer upon completion of an action. These are antivirus scanners, torrent clients, defragmentation programs and others.

More posts on the topic

tomcomp.com.ua

Computer made easy - Automatically shutdown your computer at a specified time

Sometimes, when the computer is busy performing a task, and you need to leave, you need the computer to turn off automatically. Some programs have this option in their settings, and some do not. Maybe you like to fall asleep while watching movies, it doesn't really matter what you need it for.

We will talk about special programs for automatically shutting down a computer in other materials, and now we will touch on the built-in program for automatic shutdown of a PC (yes there is one), this program is controlled from the windows command line. The program is present in both windows XP and windows 7, so this lesson is relevant for both operating systems.

Click the "Start" button and go to the "Programs> Accessories" menu and select "Command Prompt"

Command Prompt will appear

Type shutdown /? press Enter. Now you can see all the parameters of the shutdown utility

For our task, we will use only three parameters

s - shutdown the computer;

t is the time after which the work will be completed, in seconds;

a - cancel system shutdown.

So, in order to turn off the computer, for example, after one hour, you need to type shutdown -s -t 3600 at the command line

In windows 7, the message that the command will be executed in the tray will look like this:

In windows XP, the result of the automatic shutdown program will be such a window with a reverse time report

It is also convenient to use this command with the desired parameters in the Start> Run menu.

If, after starting the auto-shutdown program, it becomes necessary to cancel it, you need to write shutdown -a

For windows XP - The program for automatically shutting down the computer "Shutdown Timer"

For windows 7, for these purposes, you can use the task scheduler or Auto Shutdown The program to automatically shutdown your windows 7 computer

prostocomp.com

How to set up automatic shutdown of the computer on windows 7?!

Hello, friends! After reading this article to the end, you will learn how to set up an automatic shutdown of your computer after a specified time. I think it happened to everyone that it was necessary to leave the workplace, but some task was being performed on the computer. In this case, the computer had to be turned off after it was completed. It's good if the program itself allows you to turn off the computer. Well, if, for example, you are downloading a file, and you know how long it will take to complete the download, but you urgently need to go somewhere? What can be done in this case? The answer is simple, you need to use the shutdown utility. 1) First, let's run it in command line mode to see all the functions of this utility. I will show using windows 7 as an example, but do not be alarmed, in XP the process is almost the same. Go to the "Start" -> "All Programs" 2) Then select "Standard" -> "Command Line" 3) The command line appears in front of us. Enter the shutdown /? and press Enter. 4) Now we see all the parameters of this utility. But we do not need all, but only 3, I highlighted them in the screenshot:

  • / s - shutdown the computer;
  • / t - time after which the work will be completed, in seconds;
  • / a - cancel the system shutdown.
5) Therefore, in order for the automatic shutdown of the computer to occur in an hour, you need to enter the shutdown -s -t 3600 command. If you want to cancel this process for some reason, then enter the shutdown -a command

Conclusion

Well, that's basically all that I wanted to tell you in this article. Now you can configure the automatic shutdown of your computer under windows 7. As you can see, it's not so difficult. In order not to forget the necessary commands, I advise you to add this page to your browser bookmarks (an asterisk in the url input line) Sincerely, Alexander Sidorenko!

webexpertu.ru

How do I set up an automatic shutdown of my computer?

Working at a computer does not always imply constant sitting in front of the monitor, the presence of your fingers on the keyboard, or occasional clicking of the mouse. There are cases when the task can be completed for a long time and does not require your constant participation. And it's time to go do other things or go to bed, but the thought of a computer turned on is unlikely to add peace to you. Such situations most often occur when a complete system check with an antivirus program occurs (especially if there are many heavy toys on the computer ...), when installing serious volumetric software or downloading a large amount of information from the Internet (for example, several seasons of a popular TV series in HD quality) ... Cases with transcoding video files, backing up hard disk partitions are also suitable for these conditions.

I will not argue that many programs participating in such lengthy processes have an option that allows you to control the shutdown of the computer at the end. But what to do and what to do when such a function is not provided in the program, or there are still a number of processes in the background that prevent the computer from shutting down? In this case, there are no other options but to use the automatic shutdown of the computer. This can be implemented in two ways: through specialized software (this is the method I prefer, by the way, the following material will be about it) and by standard windows tools. Let's look at how you can set up an automatic shutdown of your computer using standard operating system tools.

In the "Control Panel" windows (called through the "Start" menu) there is a tool called "Task Scheduler". Setting it up is a snap, especially after reading this article. In order to know at what point in time to configure the shutdown, you need to decide when the long process that you started will be completed. Here you can navigate by the built-in timers of such programs, which usually report the approximate time until the end of the process (you can safely add up to 30% of the time to it), or you can be guided by experience or intuition. The easiest way to open the "Task Scheduler" is by entering the search query "scheduler" in the "Start" menu, you will also find it in the "Administrative Tools" item in the "Control Panel".

The status of active tasks can always be viewed in the "Scheduler Library", and for our purpose we need to "Create a simple task".

First, you need to give a name to the task, say, "Power Off", and then set the frequency of launch (if the task is one-time, you can select the option "Once") and the required exact time of the task.

Next, set the parameter "Run the program" and write its name shutdown, set the arguments -s -f. The -f startup switch is required to force terminate applications that prevent the computer from shutting down.

By clicking on "Finish", we complete the creation of the task, after which, in accordance with the figure, we make changes on the "Triggers" tab.

If you need to change the shutdown time of the computer, you can always find this task in the "Scheduler Library".

It is easier to configure the system to shutdown after a specified time interval without resorting to using the "Task Scheduler". To do this, in the command line (Win + R or Run in the Start menu), enter the following command: shutdown -s -t 600 (600 is the time in seconds before shutdown). Next, press Enter.

After the time specified in the command has passed, the system will display a window with a message about the shutdown and after a minute the computer will be turned off. To cancel this timer, use the shutdown -a command. And do not forget that one hour is not 1024, but 3600 seconds!

The question of how to make the computer turn off after a certain time is relevant for a large circle of people, and for almost any user of a personal computer.

In the case when, for business purposes, the computer is busy performing a certain task or a powerful program is running that performs long-term processes, the user may need to suddenly and for a long time be absent.

It is not always possible and advisable to leave a computer unattended for a long time, even if it has already completed its task. But, unfortunately, not all programs have a built-in function to turn off the computer after the end of their work.

In addition, in the case of, for example, using a personal computer at home, it may also be necessary to turn off the computer after a certain period of time.

For example, if the user risks falling asleep while watching a movie, or, again, the computer is loaded with a task, the execution of which will end late at night, but there is no time to wait.

In these and any other situations, shutting down your computer at the right time will help the following series of methods, which are given below in this article. Among the possible options is the ability to use built-in system functions, as well as specialized programs.

How to make the computer turn off after a certain time

First of all, you should pay attention to the ability to configure the automatic shutdown of the computer, which is built into the windows operating system. Few people know about such a function, since it is called by way and controlled through the command line, using the appropriate commands.

So, first of all, you need to call the command line itself. This can be done by following the following path:

Start -> Programs -> Accessories -> Command Prompt.

In the command line that opens, type the shutdown command, which will display a list of possible settings. Among all the proposed options, only 3 lines are required:

  • S - indicator responsible for shutting down the PC;
  • t is the time, in seconds, that determines when the job will end;
  • a - the function of canceling the shutdown.

For example, a user needs to automatically turn off the computer after exactly one hour. To do this, type the following command in the command line: shutdown –s –t 3600.

If it is necessary to cancel an already running timer, you must write the command: shutdown -a

Also, for this function, you can use special programs, of which there are simply a huge number on the network, so download and use.

Programs for automatic shutdown of the computer

There are many different programs that have the ability to automatically turn off the computer, as well as wake it up from sleep mode, or, on the contrary, immerse it in it. In addition, you can schedule a reboot as well as set a reminder notification.

However, not all such programs are multifunctional and some of them have a fairly simple and even primitive interface. In such programs, the set of options can be minimal so that the user only needs to specify the desired shutdown time and start the timer.

Immediately before shutting down, many programs issue a notification and, if the user has not yet finished his work session, the timer can be reassigned. Thus, these programs take care not only of the user's comfort, but also of the safety of the working data and the computer itself.

So, above was considered the system standard way of how to make the computer turn off after a certain time. Now you can pay attention to special timer programs designed to automatically turn off your computer.

Consider the programs from the following list that have received the most distribution and a lot of reviews:

  • Time PC;
  • Sleep timer 2007;
  • OFFTimer;
  • SM Timer.

Is a powerful enough timer to shutdown computers at a specified time. This program works without installation, starting immediately after downloading. There is a fairly large set of options here, but most of them are necessary for advanced users.

In addition to timers, it has its own diary and task scheduler, and in addition, the program can be manipulated using the appropriate hotkeys.

- this is a fairly simple, but unique program that can not only turn off the computer on a timer, but also turn it on when necessary. This program basically uses the hibernation function.

This implies that the contents located in RAM are transferred to the hard disk, which allows the running programs to continue the next time they are started. There is also a scheduler of timers for the week ahead, which is also very convenient.

Sleep timer 2007- this program shuts down, restarts, and also puts the computer into sleep mode. In addition, it mutes sound effects rather smoothly and forcibly terminates current processes. This program does not require installation and starts immediately after downloading.

OFFTimer- is, perhaps, the most primitive version of the timer for turning off the computer. It does not need to be installed, and has only one function - a timer that allows you to turn off the computer at a specified time. Immediately before shutting down, the program issues a notification that makes it possible to terminate processes or cancel the shutdown at the user's discretion.

SMTimer- a simple program that has primitive controls and interface. It is aimed at terminating a working session and shutting down the computer at a time specified by the user.

Using the considered recommendations and programs from this article, each user can easily set up a timer to automatically turn off his computer. I hope now you will not have any questions about how you can turn off your computer using programs.

How many ways do you know to shut down your computer?

At first glance, nothing is easier than shutting down your computer. However, if you search, you will find a lot of ways to do this, both regular and not very. By the way, one of the most unusual ways to turn off the computer, which I had to face, was to kick the button on the uninterruptible power supply unit, which was under the table. And in this article, I tried to collect all the methods I know of to shutdown the computer correctly.

Let's start with simple and affordable shutdown methods. For example, let's take Windows 8.1, as the most relevant operating system at the moment.

Sharms panel

Press the keyboard shortcut Win + I and in the panel that opens on the side we find the shutdown button. You can also reach this panel by hovering your mouse pointer to the right corner of the screen, or (for a touchscreen) by swiping your finger from the right edge to the center and selecting the Options button.

Context menu

Right-click on the Start button or press Win + X, in the context menu that opens, select "Shutdown or logout". This feature appeared in Windows 8.1, apparently as an attempt to compensate for the lack of the familiar Start menu.

CTRL + ALT + DEL

Familiar keyboard shortcut Ctrl + Alt + Del opens us the security settings screen, which also has a button to turn off the computer.

Lock screen

There is a shutdown button on the lock screen. You can quickly get to this screen using the keyboard shortcut Win + L, or by clicking on your avatar on the start screen.

ALT + F4

Keyboard shortcut Alt + F4 calls a window in which you can select an option for shutting down the computer.

Power button

Of course, the computer can be turned off with the power button, and quite correctly. To do this, go to Control Panel, open the Power Options snap-in, select your current power plan, and specify shutdown as the action when you press the computer's power button. Now when you press the power button, the operating system will shut down routinely... For laptops, you can configure the action when closing the lid in the same way.

Note. Just in case, let me remind you that when you press and hold the power button more than 5 seconds the computer shuts down in an emergency, no matter what.

shutdown.exe

You can shut down your computer using the shutdown.exe console utility. This utility has quite a few parameters, here are some of them:

/ p - immediate shutdown of the computer without warning;
/ s - close applications and shutdown the computer;
/ r - shutdown followed by restart of the computer;
/ h - switch to hibernation mode;
/ t xx - delay before shutting down the computer in seconds, used with the / s or / r switches. The default is 30 seconds;
/ f - forcibly close all running applications. The default is used when using the / t switch with a non-zero delay;
/ a - cancel shutdown.

There are several options for using shutdown.exe. For example, you can press Win + R, enter the shutdown / s / t 30 command and click OK.

This command will issue a warning and turn off the computer after 30 seconds.

Another option for using the utility is to call the graphical interface using the shutdown / i command. In the program window, you must enter the name of the computer, select the desired action, the shutdown delay, and also indicate the reason for shutdown and leave a comment. All this data will be recorded in the system log.

You can run shutdown.exe from a command line running with administrator privileges, for example:

shutdown / s / t 60 / f / c ″ Shutdown ″

This command will close all running applications and shutdown the system after 60 seconds with a comment.

Alternatively, you can create a shortcut for shutdown.exe and place it on the desktop, in the control panel, or on the start screen. It is very convenient, you can turn off the computer with one click, or specify a keyboard shortcut for shutdown.

PsShutdown

The Sysinternals PsShutdown utility is an analogue of the standard shutdown.exe and is part of the PsTools suite. The utility does not require installation, just download it and unpack it to the system folder% windir% \ system32. The syntax is familiar, for example, to shutdown with a 1 minute delay, run the command psshutdown -s -t 60.

Once PsShutdown was much cooler than a standard switch, but at the moment they are almost identical in their capabilities.

Moving on to heavy artillery 🙂

PowerShell

To shutdown the computer in PowerShell, it is enough to enter the Stop-Computer command in the console opened with administrator rights. This cmdlet does not provide any additional parameters for delaying or entering a comment, only immediate shutdown.

Digging a little deeper, we can see that the cmdlet uses the Win32Shutdown method of the WMI Win32_OperatingSystem class to shutdown. This method has several arguments, so using WMI, the command to shutdown would look like this:

(Get-WmiObject Win32_OperatingSystem -EnableAllPrivileges) .Win32Shutdown (1)

You can specify 1 (shutdown), 2 (reboot), 8 (power off) as an argument.

The Win32Shutdown method does not allow you to specify additional parameters, so we will use the Win32ShutdownTracker method, which allows you to specify the shutdown delay, comment, reason code, and shutdown type. Here's what happened:

(Get-WmiObject Win32_OperatingSystem -EnableAllPrivileges) .Win32ShutdownTracker (″ 60 ″, ″ Shutdown with PowerShell ″, ″ ″, ″ 1 ″)

This command shuts down the system with a one minute delay and displays an appropriate message.

Automatic shutdown

To conserve power, you can configure the computer to go into hibernation mode when idle. To configure, click Win + R and enter the command powercfg.cpl(another way to open the Power supply snap-in), select the control scheme and in the "Sleep" item set the time of inactivity, after which the computer will go into hibernation. The same setting can be done from the command line with the command POWERCFG / CHANGE hybernate-timeout-ac 30.

Note that using hibernation is much more convenient than simply shutting down the system and turning off the power.

Scheduled shutdown

And finally, one more non-standard way to turn off your computer. If you are a workaholic and do not notice the time spent at the computer, then using the task scheduler, you can configure the completion of work on a schedule, at a specified time. This can be done with a simple 🙂 command executed from the command line with administrator rights:

schtasks / create / TN Shutdown / RL Highest / RU ″ System ″ / SC Daily / ST 00:00 / TR ″% windir% \ system32 \ shutdown.exe / s / t 60 / c \ ″ Time to sleep !!! \ ″ ″

This command creates a scheduled task named Shutdown that shuts down the computer at midnight every day. The / RL Highest switch means launch with elevated privileges, and / RU ″ System ″ starts the task on behalf of the system, regardless of the presence of a user.

As a result, at 12 o'clock at night, you are guaranteed to receive such a warning.

Well, like everything, I personally do not know more ways to turn off. And you?

Top related articles