A shutdown terminates all active users and all active programs. The following steps occur during a shutdown:
1) An exit command is issued to all active user applications
2) If the application doesn't exit within a specific time, the application is terminated
3) After all applications under a user exit, the user is logged out
4) After all the users are logged out, an exit command is issued to all the system services
5) If the system service doesn't exit within a specific time, the service is terminated
6) The file system cache is written to disk
7) The disks are marked readonly
8) The system is rebooted.
Steps 1-5 can be skipped by using "/now" shutdown option.
shutdown /now /reboot