Qual é a diferença entre “shutdown / r” e “shutdown / g” no Windows?

Índice:

Qual é a diferença entre “shutdown / r” e “shutdown / g” no Windows?
Qual é a diferença entre “shutdown / r” e “shutdown / g” no Windows?

Vídeo: Qual é a diferença entre “shutdown / r” e “shutdown / g” no Windows?

Vídeo: Qual é a diferença entre “shutdown / r” e “shutdown / g” no Windows?
Vídeo: TOP 5 LAUNCHER + 1 BÔNUS ICON PACK ANIMADO/ 5 MELHORES LAUNCHER PARA ANDROID - YouTube 2024, Abril
Anonim
Quando você começa a investigar todas as opções disponíveis no Windows, você pode se surpreender com o que pode encontrar. Levar a
Quando você começa a investigar todas as opções disponíveis no Windows, você pode se surpreender com o que pode encontrar. Levar a

shutdown /r

e

shutdown /g

comandos, por exemplo. Qual a diferença entre eles? A postagem de perguntas e respostas do SuperUser de hoje tem a resposta para a pergunta de um leitor curioso.

A sessão de perguntas e respostas de hoje nos é oferecida por cortesia do SuperUser, uma subdivisão do Stack Exchange, um agrupamento de sites de perguntas e respostas conduzido pela comunidade.

A questão

O leitor do SuperUser gate_engineer quer saber qual a diferença entre “shutdown / r” e “shutdown / g” no 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 é a diferença entre “shutdown / r” e “shutdown / g” no Windows?

A resposta

DavidPostill, colaborador do SuperUser, tem a resposta para nós:

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]

Tem algo a acrescentar à explicação? Som desligado nos comentários. Quer ler mais respostas de outros usuários do Stack Exchange com experiência em tecnologia? Confira o tópico de discussão completo aqui.

Recomendado: