• Computer reboot, end session, shutdown. Restarting the computer from the command line - shutdown command

    Remote access to the desktop via the RDP protocol is widely used to work not only with servers, but also with workstations, both for remote work and for administration purposes. However, there are some restrictions; in particular, in a client OS environment, you cannot manage power settings, even if you have rights local administrator. In some cases, this can cause difficulties, so if you still don’t know how to turn off or reboot the client version of the OS via RDP, this article is for you.

    On server systems Windows family a local administrator, not to mention a domain administrator, has full control over the system and has no difficulty in managing power even when connecting via remote access.

    In client operating systems, the situation is fundamentally different; even a local administrator does not have the ability to turn off or restart the computer.

    Despite the apparent illogicality, there is a certain meaning in this behavior. Server OSes are administered by professionals (at least in theory), who must be aware of possible consequences of your actions. On the other hand, by turning off the PC remotely, you won’t be able to turn it on so easily; in most cases, a physical presence will be required, so the decision to remove such a function from ordinary users looks quite reasonable. Administrators, following this logic, must be able to manage power in other ways.

    But as practice shows, not everyone can do this. There is nothing wrong with this, as my school teacher said: asking is the shame of a moment, not knowing is the shame of a lifetime.

    Graphic shell

    In fact, the “problem” is not easily solved, but very simply. When you go to your desktop, just click Alt+F4 to get the standard shutdown dialog.

    However, this method has one significant drawback. Very often, some applications interfere with shutting down or restarting the computer, for example, unsaved document. This picture, in our opinion, is familiar to everyone.

    The trouble is that you will no longer see this screen via RDP. Yes and open applications- this is not so bad, it’s worse when the system is prevented from turning off or restarting a frozen application. In this case, you will have to look for other methods.

    Command line

    As usual, if graphical tools do not help, the command line comes to the aid of the administrator. In order to control the computer's power using it, you do not need to have any special knowledge, just remember one simple command. Click Win+R or Start - Run and enter the following commands:

    Shutdown -s -f -t 0

    to turn off

    Shutdown -r -f -t 0

    to reboot.

    Let's look at the command keys in more detail:

    • s- shutdown the computer
    • f- forced termination of processes that interfere with rebooting
    • t- the time after which the work will be completed is indicated in seconds separated by a space. If this parameter is not used, the command will be executed after 60 seconds.

    PsShutdown utility from Sysinternals

    If the standard capabilities do not suit you for some reason, then you can use an alternative - the PsShutdown utility from Sysinternals. Place the downloaded file in any convenient place, preferably in one of those specified in the PATH variable, or add its location there, this will allow you to run it on short name, without specifying the path. The syntax of the utility is similar to the standard syntax, but there are some differences, so to disable it, run:

    Psshutdown -k -f -t 0

    and for reboot:

    Psshutdown -r -f -t 0

    Let's explain the keys used:

    • k- system shutdown
    • f- forced termination of processes
    • t- command execution time

    If instead of a key -k use the key to turn off -s, then the system will shut down without turning off the power, old-timers should remember well:

    Besides, this utility allows you to manage power to other PCs over the network. To be honest, the standard shutdown utility can also work over the network; just specify the key:

    M\\computer

    But there is one significant drawback - the command is executed in the context of the user who launched it, so you will not be able to turn off your work PC from home, even if you have access to corporate network via VPN and having network administrator credentials.

    PSShutdown this deficiency is deprived and allows you to specify credentials for connecting to a remote PC, for example:

    Psshutdown \\computer -u username -p password -r -f -t 0

    This command will reboot the remote PC computer using the name to connect username and password password. Please remember that the user you specify must have access rights to the administrative resource ADMIN$. In the environment Active Directory The domain administrator has this right, but difficulties may arise in a peer-to-peer network.

    If you try to turn off remote system even using local administrator credentials, you will most likely receive an error Access denied.

    This indicates that this user does not have access to the resource ADMIN$. To enable it you need to fulfill two conditions: enable general access to files and printers

    And then to the registry branch

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System

    add a DWORD parameter named

    LocalAccountTokenFilterPolicy

    and set its value to 1. After this, the computer will need to be restarted.

    Let's try to turn it off remotely again.

    As we can see, this time the command worked successfully.

    PowerShell

    Using PowerShell to shut down or restart your computer is akin to shooting sparrows with a cannon, but in some cases it can be useful.

    To turn it off use the command:

    Stop-Computer-Force

    And to reboot:

    Restart-Computer-Force

    Key -Force V in this case similar to a key -f teams shutdown and involves forcing the shutdown of applications that interfere with shutdown.

    PowerShell can also be used to manage power over the network, for example, you can turn off a remote PC with the command:

    Stop-Computer -ComputerName computer -Credential username -Force

    Where are the keys:

    • ComputerName- name of the remote computer, it is allowed to list several names separated by commas
    • Credential- Name account for authentication in a remote system

    At the same time, working through PowerShell is more secure, since the password is not entered in clear text and does not remain in the command history. Standard OS mechanisms are used for authentication.

    As you can see, a wide variety of tools are available for power management in Windows OS - for every taste and color. Moreover, all of them are available within the terminal session; which one to use is a matter of personal taste and preference.

    • Tags:

    Please enable JavaScript to view the

    Team SHUTDOWN used to end a user session, restart the computer, put it into sleep mode, or turn off the power. If you have the appropriate permissions, the command can be executed on a remote system.

    Format command line:

    SHUTDOWN.EXE xx:yy ]

    If no parameters are specified on the command line, or if the parameter is specified /? - then brief information on using the command is displayed on the screen.

    Instead of syntax /key allowed to use -key:

    SHUTDOWN.EXE [-i | -l | -s | -r | -g | -a | -p | -h | -e] [-f] [-m \\computer][-t xxx][-d xx:yy [-c "comment"]]

    Command line options:

    /i- Display the graphical user interface. This parameter must come first.
    /l- End the session. This option cannot be used with parameters /m or /d.
    /s- Shut down the computer.
    /r- Shut down and restart the computer.
    /g- Shut down and restart the computer. After the system restarts, launch all registered applications.
    /a- Cancel system shutdown. This option can only be used during the waiting period.
    /p- Immediate shutdown local computer without warning. Can be used with parameters /d And /f.
    /h- Switching the local computer into hibernation mode. Can be used with parameter /f.
    /e- Indicate the reason for the unexpected shutdown of the computer.
    /o- Go to the advanced boot options menu and restart the computer. This parameter valid for Windows 8 and later. Must be used with the /r parameter.
    /m\\computer- Name or IP address target computer.
    /t xxx- Set a delay of xxx seconds before shutting down the computer. Valid range: 0-315360000 (10 years); default value: 30 seconds. If the timeout period is greater than 0, the parameter is applied /f.
    /c "comment"- Comment with the reason for restarting or shutting down. The longest length is 512 characters.
    /f - Forced closure running applications without warning users. Parameter /f used if for parameter /t a value greater than 0 is specified.
    /d xx:yy You must specify a reason for rebooting or shutting down. "p" means scheduled reboot or shutdown. "u" means the reason is user defined. If neither "p" nor "u" is specified, the reboot or shutdown is unplanned. xx is the primary reason code (a positive integer less than 256). yy is the auxiliary reason code (a positive integer less than 65536).

    To manage the shutdown and reboot processes, the user must have administrator rights in relation to the managed system.

    Examples of using the SHUTDOWN command:

    shutdown or shutdown/?- display help on using the command.

    shutdown /s- turn off the computer power after 30 seconds. The user will be notified of the scheduled shutdown.

    shutdown /s /t 0- Turn off the computer's power immediately.

    shutdown /s /t 60 /m \\COMP7- turn off the power of the COMP7 computer after 60 seconds.

    shutdown /s /t 60 /m \\192.168.0.1- turn off the power of the computer with IP address 192.168.0.1 after 60 seconds. If necessary, a user with administrator rights can cancel the shutdown process with the command shutdown -a

    shutdown /h- put the computer into hibernation mode. When a command is executed, all information from RAM(processes, programs, data) are stored in special file hyberfil.sys located in the root directory system disk and a normal power shutdown is performed. The next time you turn on the computer, the manager Windows boot(BOOTMGR) will perform a system state restore from a file hyberfil.sys. Hibernate mode must be enabled for of this computer, for example by the command powercfg /H on or by using the Panel Power Options snap-in Windows management. Also, it is necessary to take into account that in order to implement this mode a large volume will be required free space on the hard drive for a copy of the RAM.

    shutdown /l- end the current user's session. The end session command can only be executed on the local computer and only for the current user. Same as running the command logoff without parameters.

    shutdown /r- reboot the local computer. By default, the reboot will occur after 30 seconds if the option is not specified /t

    shutdown /r /o /t 0- reboot the local computer immediately ( t 0, with choice additional options (/o. After the reboot, a menu for selecting actions is displayed on the screen, with which you can either continue normal download, or choose additional modes for diagnostics and system recovery. Parameter /o acceptable for operating rooms Windows systems 8 and later.

    shutdown /r /m\\192.168.0.1- reboot the computer with IP address 192.168.0.1.

    shutdown /g- reboot and restore execution of applications registered using API functions RegisterApplicationRestart. Typically used when updating the system, when the installation process requires a reboot to continue the installation process.

    Reboot your computer, displaying the "Scheduled reboot" message and writing to syslog reasons - "Planned", main code - "12" (0x0B), additional code- "555" (0x022b).

    shutdown /i- launching the graphical environment of the utility shutdown.exe. The “Remote Shutdown Dialog” appears on the screen.

    To perform a shutdown, reboot, or end user session operation, you must enter a name or IP address computer using the "Add" button, select the desired action, reason and fill in the "Comment" field, the text from which will be displayed in information message about the planned action. For most reasons, the comment field is required, and without filling it out the "OK" button will be inactive.

    On Windows 7 and later, remote shutdown or reboot using the command shutdown, may fail with the error “Access denied (5)” even if you have administrator rights and allow remote forced shutdown in local group policies. In addition, when accessing hidden administrative resources C$, ADMIN$...etc. The remote computer is prompted for a username and password, but the connection is denied access. The problem is solved by removing the computer from home network and adding (changing) a registry parameter to the section:

    hklm\Software\Microsoft\Windows\CurrentVersion\Policies\System
    need to add parameter LocalAccountTokenFilterPolicy, taking the value dword:00000001

    After entering data into the registry, a reboot is required to apply the changes.

    In addition:

    Power management in Windows command line - command

    Restart your Windows 8 computer in the usual way quite simple. Much more difficult to implement this operation, if for some reason standard means to carry out this procedure are simply not available.

    In such a situation, you can resort to various other methods. All of them are safe for both the operating system and the data contained on the computer.

    Restarting a PC running Windows 8 is quite simple. This can be done in different ways.

    The most accessible and frequently used by ordinary users are the following methods:

    They can be used either as needed or simply as desired. Each method has its own advantages and disadvantages.

    If necessary, you can restart the operating system even before the desktop is fully launched and turned on.

    In order to do this, you must follow these steps in strict order:

    When the required item is found, simply click on it with the left mouse button. After this, the operating system will reboot.

    From desktop

    In most cases, for ordinary users who have just started using Windows 8, restarting the operating system after starting it can cause some difficulties. Since the desktop of the OS in question is very different from the desktop previous versions operating systems Microsoft with your device.

    To perform a system restart you must:

    If for some reason it is not possible to use the mouse, or the user cannot find desired menu, you can simply press the key combination “Win” + “I”. After this, a menu will open with options for various actions, among which again there will be the “Restart” item.

    Keyboard shortcut Ctrl+Alt+Delete

    A restart can also be accomplished using a three-key combination – Ctrl+Alt+Delete.

    To do this, you must follow these steps in strict order:

    • hold down the Ctrl+Alt buttons, then just press Delete once;
    • a special window will open containing a small list;
    • in the lower right corner there is a “Power” button, which has a completely standard designation;
    • after clicking on this shortcut, a small context menu, in which we click on “reboot”.

    This method is quite simple to implement. Its only drawback is the need to press several keys at the same time. For some users, this is quite problematic for various reasons.

    How to restart your computer via the Windows 8 command line

    The restart is also carried out using the command line, which can be launched very quickly in any OS from Microsoft. In the eighth version, you can use two methods to launch the command line.

    The easiest way to do this is:

    • press the key combination “CTRL” + “R” - call up the field for entering a command;
    • in the window that opens, write “cmd.exe”;
    • press “Enter”.

    There is one important drawback to using this method - it is launched on behalf of the current user.

    To run Command Prompt as administrator, follow these steps:

    If desired, it will be possible not only to launch the function in question, but also to perform other actions with it. To perform a restart, you must enter the appropriate command - “Shutdown” or “Ping”.

    Video: Installing shutdown buttons

    Shutdown Team

    To use the Shutdown command, you need to perform the following simple operations:

    1. launch the command line using one of the methods listed above (the most convenient and appropriate in a particular situation);
    2. use the keyboard to enter “Shutdown”;
    3. press the “Enter” key.

    An important advantage of the Shutdown command is that it is very versatile. Using it you can also remotely restart someone else's computer. To do this, just leave one space from the last character of the command and enter the letter “i” after the “/” character. A dialog box will appear allowing you to complete the operation successfully.

    Also this method makes it possible to use delayed shutdown. To do this, just add the suffix “–r” at the end of the line. After pressing “Enter”, a window will appear notifying you that the work will be completed in 1 minute. If necessary, you can select any shutdown time.

    Using the "Ping" command

    The “Ping” command is required to ping remote network devices. It is also used to prepare the remote PC for a subsequent restart. Often this stage is the most difficult for carrying out an operation of the type in question.

    To make your PC available for remote restart, you must do the following:

    • launch command line;
    • enter “Ping –n 20 127.0.0.1>NUL 2>&1 & shutdown /h /f” and press “Enter”.

    Solving reboot problems

    Sometimes situations arise when, for some reason, restarting the operating system is simply impossible. One of the most common reasons The impossibility of a normal shutdown or reboot of the OS is the lack of suitable drivers for any device. Most often it is a video card. Identify this problem simple enough.

    The most clear signs its are:

    • when you press the shutdown button, wininit.exe increases the load on the processor (50% or more);
    • begins to be consumed large number memory process called "Startup".

    Solving this problem is quite simple - you should install the most latest versions drivers for all devices. In most cases, this allows you to get rid of various problems errors that occur when trying to restart.

    Also, the inability to perform a normal restart of the OS may occur due to a “damp” version installed Windows 8. The very first distributions distributed by Microsoft have minor conflicts with some equipment. Problems of this type especially often arise in Asus technology.

    There can only be two ways out of this situation:

    • installing a later OS version;
    • installation of the latest patch from Microsoft, containing everything possible fixes(you must download it from the official website).

    Another reason for the impossibility of restarting may be previously installed software(games, office applications or something else). It is possible to determine which program is to blame for the error quite simply - by the method of elimination.

    Video: windows 8.1 shutdown button in the menu

    You should view the installation dates and delete the latest ones installed programs. The three reasons listed above are the most common when an error occurs that prevents a reboot. Usually resolving them takes a minimal amount of time and effort.

    If the problem cannot be resolved, you should contact a qualified professional. Rebooting the system is a fairly simple process for the user, but extremely necessary for the computer itself. Because long work Without clearing the paging file and RAM, it significantly reduces PC performance; you should avoid this type of situation. If it is impossible to reboot, the problem must be corrected immediately.

    Restart can be done in various ways– both ordinary ones, accessible to all users, even not the most experienced ones, and with the help of special commands. It is advisable to know them all, this will minimize the likelihood of any problems arising with personal computer.

    proremontpk.ru

    Reboot your computer from the Windows command line

    Many users of Windows operating systems are not aware that you can restart your computer directly from the command line. Windows strings. This method is convenient when you are connected to a remote computer (remote reboot), or if you need to create a restart script and run it on a schedule through the scheduler.

    So - how to restart your computer via the command line? To reboot in Windows there is a special console command shutdown. The command syntax is as follows:

    C:\Users\>shutdown -? Usage: shutdown xx:yy ] Additional options(keys): /? - Display help. Same as without parameters. /i - Display the graphical user interface. This parameter must come first. /l - End the session. This option cannot be used with the /m or /d options. /s - Shut down the computer. /r - Shut down and restart the computer. /g - Shut down and restart the computer. After the system restarts, launch all registered applications. /a - Cancel system shutdown. This option can only be used during the waiting period. /p - Immediately shutdown the local computer without warning. Can be used with the /d and /f options. /h - Switches the local computer to hibernation mode. Can be used with the /f option. /e Specifies the reason why the computer shut down unexpectedly. /m \\computer - Specifies the destination computer. /t xxx - Set a delay of xxx seconds before shutting down the computer. Valid range: 0-315360000 (10 years); default value: 30. If the timeout period is greater than 0, the /f option is applied. /c "comment" - Comment with the reason for restarting or shutting down. The longest length is 512 characters. /f - Forces closure of running applications without warning users. The /f option is used if the /t option is set to a value greater than 0. /d xx:yy - You must specify a reason for the reboot or shutdown. "p" means scheduled reboot or shutdown. "u" means the reason is user defined. If neither "p" nor "u" is specified, the reboot or shutdown is unplanned. xx - is the main reason number (a positive integer less than 256). yy is the auxiliary reason number (a positive integer less than 65536).

    Examples of use: Shutting down the computer via the command line:

    shutdown -s -t 0

    Same thing with force termination of applications:

    shutdown -r -f -t 0

    Log off user session:

    The same with the message in the window:

    shutdown -r -t 60 -s “Restart in a minute”

    Cancel delayed Windows reboot:

    If necessary, commands can be placed in a BAT file and used as a script!

    set-os.ru

    How to reboot a Windows server via command line

    Hello everyone, I’ve already been asked several times about how to reboot. Windows server via the command line. Today I will answer it by talking about several ways to do this. What can this be used for, for example, to write a script that right time will reboot the server, or for self-development, the motives may be different, let's see how to do this.

    Reboot via command line

    We will reboot via the command line Windows Server 2008 R2, but this instruction Suitable for both 2012 R2 and any client OS, even from Windows 7 to Windows 10. First, we will look at the classic cmd, open it (read how to open the command line here). To reboot, use the following command.

    T - time equal to 0

    It will start instantly reboot Windows.

    Shudown utility syntax

    Below is detailed information on all possible parameters of this utility; I think you will be able to find a lot of useful information for various tasks.

    Z:\>shutdown Usage: shutdown

    xx:yy ]

    /i Displays the graphical user interface. This parameter must come first. /l End the session. This option cannot be used with the /m or /d options. /s Shuts down the computer. /r Shut down and restart the computer. /g Shut down and restart the computer. After the system restarts, launch all registered applications. /a Cancels system shutdown. This option can only be used during the waiting period. /p Immediately shuts down the local computer without warning. Can be used with the /d and /f options. /h Switches the local computer into hibernation mode.

    For convenience, you can create a shortcut in which you can insert this command, or create cmd or bat file for convenience. So do I this opportunity used in mmc console. In addition to the fact that you can reboot via the command line, it is possible to do the same via PowerShell.

    How to reboot a server using PowerShell

    Microsoft has been bringing its strong language to the masses for a long time, and I must tell you it is very functional, but more on that later. PowerShell also has the ability to reboot your server or computer through its command line, this is done very simply. Open PowerShell and enter this cmdlet

    Restart-Computer computer name

    Or for several

    Restart-Computer "computer name1", "computer name2"

    Quite simply, it is possible to reload the list of servers. I’m sure now you won’t have any problems restarting your computer via the command line. There are, of course, a large number of such utilities, but they need to be delivered. The two means described are already Windows components and do not require installation, which means their immediate use, and the less installed on the server, the better, it is more secure, since any third-party software needs to be updated and monitored.

    Material from the site pyatilistnik.org

    pyatilistnik.org

    How to Restart or Shut Down Your Computer Using the Command Prompt

    In this article we will tell you how to manage your computer's power from the console or powershell.

    Shutting down from the command line

    To shutdown, reboot, or hibernate using the command line, use the shutdown command. List of command parameters:

    • -s – Power off;
    • -h – Hibernation;
    • -t xxx – specifying the delay time (pause) before executing the shutdown command. To reboot or shutdown immediately, use the -t 000 option.
    • -c – Output a comment.
    • -f – Force shutdown of applications. This option is used when the -t option is set to a value greater than 0.
    • -a – Cancel shutdown.

    For example,

    shutdown -r -f -t 180

    We receive the message:

    If you specify a delay of more than 600 seconds (10 min) with the -t option, another notification will appear in the system area:

    To cancel shutdown (if you have time to do so), enter the command:

    shutdown -a

    This command can be used while waiting for a command to be executed.

    To immediately restart your computer, use the command:

    shutdown -r -t 000

    To shutdown immediately use the command:

    shutdown -s -t 000

    How to create a shortcut to shutdown or restart

    Right click on empty field in any folder or on the desktop.

    Select New - Shortcut.

    In the Specify object location field, enter a string, for example:

    shutdown -s -t 30 -c "The server is shutting down! Everyone go home! (c) ADMIN"

    Enter a custom shortcut name.

    Click Finish:

    When you click on a shortcut, the specified action will be performed:

    Checking the operation of the batch file:

    If you want to create batch file in *.cmd or *.bat format, we recommend using the AkelPad program for this and saving files in 866 encoding (OEM - Russian):

    compfixer.info

    How to restart Windows 7 from the Command Line

    Usually the reboot is done in graphical interface Windows or by clicking on physical button. We will look at the third method - reboot using the “Command Line” (“Cmd”). This handy tool, providing speed and automation of various tasks. Therefore, it is important to know how to use it.

    Reboot with different keys

    To perform this procedure, you need Administrator rights.

    Read more: How to get Administrator rights in Windows 7

    First of all, you need to launch Command Prompt. You can read about how to do this on our website.

    Lesson: How to open the command line in Windows 7

    The “Shutdown” command is responsible for restarting and shutting down the PC. Below we will look at several options for restarting your computer using different keys.

    Method 1: Simple Reboot

    For a simple reboot, enter in cmd:

    A warning message will appear on the screen and the system will restart after 30 seconds.

    Method 2: Delayed reboot

    If you want to restart the computer not immediately, but after a while, in “Cmd” enter:

    shutdown -r -t 900

    where 900 is the time in seconds before the computer restarts.

    A message indicating a scheduled shutdown will appear in the system tray (lower right corner).

    You can add your comment so you don't forget the purpose of the restart.

    To do this, add the “-c” switch and write a comment in quotes. In Cmd it will look like this:

    And in the system tray you will see the following message:

    Method 3: Reboot the remote computer

    You can also reboot remote computer. To do this, you need to add its name or IP address separated by a space after the “-m” key:

    shutdown -r -t 900 -m \\Asmus

    Or like this:

    shutdown -r -t 900 -m \\192.168.1.101

    Sometimes, if you have Administrator rights, you may see the “Access denied (5)” error.


    Cancel reboot

    If suddenly you decide to cancel the system restart, in the “Command Line” you need to enter

    This will cancel the reboot and the following message will appear in the tray:

    This is how you can easily restart your computer from the Command Prompt. We hope this knowledge will be useful to you in the future.

    We are glad that we were able to help you solve the problem.

    Venerable system administrators All over the world people prefer to use the command line. Psychological reason- feel superior to regular user, no matter how trivial it may be. But there is a real need - the command line gives much more flexibility in managing the system.

    It would seem that this statement concerns only Linux systems, where command line control is the most developed and traditional way. But this is a stereotype. After all, NT-based Windows has almost the same administration tools as Unix, only the commands are named a little differently. For example, if a reboot from the command line in Linux can be done with a simple reboot, then in Windows you need to type commands with parameters.

    There is even more than one way to “ask” the system to reboot! The most obvious is to use the shutdown.exe utility. A simple reboot with its help is done like this - shutdown -r -t 0. This means ordering the system to reboot immediately. Numerous parameters, the purpose of which can be found out in more detail by running the shutdown command with the "-?" switch, allow you to display a warning sign to the user. For example, a variation of the command shutdown.exe -r -t 60 -c. A maintenance reboot after 60 seconds will display this sign on the screen and create a short delay of one minute, which will allow the user to save documents. It should be noted that the comment is limited - no more than 127 characters can be specified.

    Rebooting from the command line can be started with the "-f" switch, then applications will be terminated forcibly, without warning. There is often a situation when you are on the go wondering whether to restart your PC. Before it's too late, specify the shutdown command with the -a switch, which will cancel the reboot.

    Besides standard utility, which can be used to reboot from the command line, there are other methods, some of them are original, but many come from Unix systems. One such command is clearly inspired by Linux systems. See how sophisticated Windows can be rebooted from the command line: ping -n seconds 127.0.0.1>nul&wmic OS WHERE Primary="TRUE" CALL Win32Shutdown 6.

    Please note that the redirection icon is used, there is also a mention of nul. Naturally, instead of -n seconds, you need to specify the number after which you plan to restart.

    One of the foundations of Windows management is the rundll32.exe process, which is the host process. With its help they are loaded into libraries. This program has command interface, allowing you to operate with graphic elements. It can also be used to reboot from the command line: undll32 user.exe,ExitWindowsExec 2.

    Above is the easiest way to reboot using rundll32, which works on all systems.

    You can also use the usual call to the shutdown dialog: undll32 msgina,ShellShutdownDialog. Or immediately turn off the PC: RUNDLL.EXE user.exe,ExitWindows.

    There are also commands that do not work on all systems, but only on XP up to SP2. This uses a pipeline element (|), which is typical on Unix systems: echo y|net stop eventlog.

    The command works as follows: it uses a flaw to stop a vital event log service, which initiates an automatic restart.

    But the matter is not limited to the listed commands. To reboot, you can use scripts on Visual Basic(VBS), utilities from related Microsoft companies. For example, psshutdown from the Ps Tools complex, which is, in fact, an improved shutdown. Type the following command into the console: psshutdown -r -f -t 30. This will reboot the local or remote PC within 30 seconds.

    A remote reboot from the command line, say, is performed with the command psshutdown -r comp1, where comp1 is the name of the PC, they can be listed separated by commas. It would be nice to notify users about the reboot. To do this, psshutdown uses the -m switch. The standard command for rebooting remote PCs is tsshutdn.

    You may not need all of these methods, but for general development anyone who often deals with PC administration on Windows based, knowing them is very useful.