Qual è la differenza tra "shutdown / r" e "shutdown / g" in Windows?

Sommario:

Qual è la differenza tra "shutdown / r" e "shutdown / g" in Windows?
Qual è la differenza tra "shutdown / r" e "shutdown / g" in Windows?

Video: Qual è la differenza tra "shutdown / r" e "shutdown / g" in Windows?

Video: Qual è la differenza tra
Video: 24 STUNNING Best Android Launcher For 2023 [ULTIMATE COLLECTION] - YouTube 2024, Aprile
Anonim
Quando inizi a scavare in tutte le opzioni disponibili in Windows, potresti rimanere sorpreso da ciò che riesci a trovare. Prendi il
Quando inizi a scavare in tutte le opzioni disponibili in Windows, potresti rimanere sorpreso da ciò che riesci a trovare. Prendi il

shutdown /r

e

shutdown /g

comandi, per esempio. Qual'è la differenza tra loro? Il post di Q & A di SuperUser di oggi ha la risposta alla domanda di un lettore curioso.

La sessione di domande e risposte di oggi ci viene fornita per gentile concessione di SuperUser, una suddivisione di Stack Exchange, un raggruppamento di domande e risposte basato sulla comunità.

La domanda

Il lettore SuperUser gate_engineer vuole sapere qual è la differenza tra "shutdown / r" e "shutdown / g" in Windows:

I was reading through some of the options for the shutdown command in Windows when I stumbled across the following option descriptions:

I thought that when Windows restarts, every application would be closed during the shutdown process, then started again after the system boots. Some possibilities that come to mind are:
I thought that when Windows restarts, every application would be closed during the shutdown process, then started again after the system boots. Some possibilities that come to mind are:
  • 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?

Qual è la differenza tra "shutdown / r" e "shutdown / g" in Windows?

La risposta

Il collaboratore di SuperUser DavidPostill ha la risposta per noi:

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]

Hai qualcosa da aggiungere alla spiegazione? Audio disattivato nei commenti. Vuoi leggere più risposte dagli altri utenti di Stack Exchange esperti di tecnologia? Controlla la discussione completa qui.

Consigliato: