Shut down,Restart,hibernate or log off your computer via command prompt

                   Generally using of command prompt gives you a royal feel while working in windows.The more you use command prompt(cmd) you get more knowledge about the terminal(cmd).Using the command prompt  one can do various simple tricks and it gives more confidence to develop your knowledge...
            


            Now let us see how to shutdown,restart,hibernate,log off in step by step Process



                                 

 Generally Required:

                                   A computer should running windows (XP,VISTA,7,8 or 8.1)with the command prompt working perfectly

         Before starting off 


         Initial steps:

  1. Press windows key+R (or) select start->Run
  2. Now type CMD and press Enter button                 
         This command will open the Command prompt to the interface..Now you can do the following on what you want to do.

Shutdown your local machine(computer)

             Now type "shutdown -s" without the quotes in the command prompt and press Enter.Now your system or local machine gets turned off..

              Here shutdown is the command being executed and the switch -s tells the computer to shutdown.

Restart Your Local Computer

                 Type "shutdown-r" in the command prompt  and now tap the Enter key.In this case the command switch -r is telling the computer to RESTART after Shutdown.

Log Off The Current User

                 Type "shutdown -l" in the command prompt and tap the Enter key.Here the -l command switch tells the computer to log off.


                   

Shutdown a Remote Computer

                     Type "shutdown -s -m\\name of the computer"in the command prompt and press Enter.Replace \\name of the computer with the actual name of the remote computer you are trying to shutdown.As I said earlier you must have the administrative access to the computer you are trying to shutdown.To know if you have the administrative access,just press the windows key + R and there type the name of the computer and press Enter.

Note:

      If you don't remember the name of the remote computer,you can view it by opening a list of all the computers you are connected to by executing "net view" in command prompt.

     If you can connect to the computer,you will be asked to login with your Username and Password.Upon entering them,a window will display the list of all the directories available to you.This should help you know whether you can or cannot able to shutdown the remote computer.

Hibernate a Local Computer

                    Open the command prompt and type in "Rundll32.exe Powrprof.dll,SetSuspendState" without the quotes and tap Enter.Your computer should hibernate,if it does not,then you must enable hibernation to do this.

Shutdown your remote computer after a specific time

                        Type "shutdown -s -t 60" to shutdown your computer after 60 seconds.After executing this,a countdown timer displaying a warning message will be displayed.This command uses the -t command switch followed by a variable(which is 60)which represents the number of seconds after which the computer will shutdown. 

                   

Display a Message containing the reason for shutdown

                         In command prompt type shutdown -s -t 500 -c "I am tired.I don't want to work anymore."(with the quotes) and then tap Enter button.The -c switch is used in the code to give the reason for shutting down of your computer and what is followed in quotes will be displayed in the dialog box as the reason.

Hint:

       You can display any sort of funny messages you wish.

Stop a System shutdown

                Type "shutdown -a" and press Enter.This will stop the system from shutting down if the countdown to shut down has not reached 0