shutdown /r
и
shutdown /g
команди, например. Каква е разликата между тях? Днешната публикация "SuperUser Q &A" е отговорът на въпроса на любознателен читател.
Днешната сесия за въпроси и отговори ни идва с любезното съдействие на SuperUser - подразделение на Stack Exchange - обединяване на уеб сайтове с въпроси и отговори.
Въпроса
Суперузерът reader gate_engineer иска да знае каква е разликата между "shutdown / r" и "shutdown / g" в Windows:
I was reading through some of the options for the shutdown command in Windows when I stumbled across the following option descriptions:
- A holdover from previous versions of Windows that performed some type of restart trickery
- A temporary override of the system configuration’s default behavior
Is it either of these or something completely different?
Каква е разликата между "изключване / r" и "изключване / g" в Windows?
Отговорът
Доставчикът на SuperUser DavidPostill има отговора за нас:
What is “shutdown /g”?
The /g option will restart applications that are registered for restart with the RegisterApplicationRestart API.
The Windows Restart Manager (introduced in Windows Vista) supports gracefully shutting down and restarting applications that registered for restart with the RegisterApplicationRestart API.
This functionality is used by Windows Update. Thanks to the Restart Manager, when I show up to my desktop computer yawning in the morning (even following a system restart), I have my Outlook, browser, OneNote, Visual Studio, and messenger applications all lined up as they were when I went to bed.
Suppose that you want to initiate “automagically restarting” everything after a restart. As of a few weeks ago, I thought it was necessary to write a small application that uses the Restart Manager APIs (i.e. RmStartSession and RmShutdown) to do this. And then it hit me that the shutdown command must already have support for doing this. And indeed, it has:
shutdown /g
Source: Restart Windows and Restart All Registered Applications: shutdown -g [Microsoft]
Имате ли нещо, което да добавите към обяснението? Звучи в коментарите. Искате ли да прочетете повече отговори от други потребители на Stack Exchange? Вижте цялата тема на дискусията тук.