From user @shub helpful link:
- Run gpedit.msc from the Start menu search
- Go to Computer Configuration > Administrative Templates > System
- In the right pane, double-click on Verbose vs normal status messages
Once enabled, this setting makes the system display detailed status messages that show each step in the process of starting, shutting down, logging on, or logging off the system.
However, if the “Remove Boot / Shutdown / Logon / Logoff status messages” setting is enabled, this setting will be ignored.
Update: I've ended using Windows Performance Toolkit and found out that Comodo Firewall was the problematic program. After reinstalling it, Windows now shutdowns normally.