Sự khác nhau giữa “shutdown / r” và “shutdown / g” trong Windows là gì?

Mục lục:

Sự khác nhau giữa “shutdown / r” và “shutdown / g” trong Windows là gì?
Sự khác nhau giữa “shutdown / r” và “shutdown / g” trong Windows là gì?

Video: Sự khác nhau giữa “shutdown / r” và “shutdown / g” trong Windows là gì?

Video: Sự khác nhau giữa “shutdown / r” và “shutdown / g” trong Windows là gì?
Video: Làm ứng dụng "Rơi tự do" siêu đỉnh! - YouTube 2024, Tháng tư
Anonim
Khi bạn bắt đầu đào sâu vào tất cả các tùy chọn có sẵn trong Windows, bạn có thể ngạc nhiên trước những gì bạn có thể tìm thấy. Lấy
Khi bạn bắt đầu đào sâu vào tất cả các tùy chọn có sẵn trong Windows, bạn có thể ngạc nhiên trước những gì bạn có thể tìm thấy. Lấy

shutdown /r

shutdown /g

lệnh, ví dụ. sự khác biệt giữa chúng là gì? Bài đăng Hỏi & Đáp của SuperUser hôm nay có câu trả lời cho câu hỏi của người đọc tò mò.

Phiên Hỏi & Đáp hôm nay đến với chúng tôi theo lịch sự của SuperUser - một phân khu của Stack Exchange, một nhóm các trang web Hỏi & Đáp do cộng đồng điều hành.

Câu hỏi

Người đọc siêu người dùng gate_engineer muốn biết sự khác biệt giữa “shutdown / r” và “shutdown / g” trong Windows là:

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?

Sự khác nhau giữa “shutdown / r” và “shutdown / g” trong Windows là gì?

Câu trả lời

Người đóng góp SuperUser DavidPostill có câu trả lời cho chúng tôi:

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]

Có cái gì để thêm vào lời giải thích? Tắt âm thanh trong các ý kiến. Bạn muốn đọc thêm câu trả lời từ những người dùng Stack Exchange có hiểu biết công nghệ khác? Xem toàn bộ chuỗi thảo luận tại đây.

Đề xuất: