DCSIMG
Restart Windows and Restart All Registered Applications: shutdown -g - All Your Base Are Belong To Us

All Your Base Are Belong To Us

Mostly .NET internals and other kinds of gory details

Restart Windows and Restart All Registered Applications: shutdown -g

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 come yawning to my desktop PC in the morning, even following a system restart, I have my Outlook, browser windows, OneNote, Visual Studio, and Messenger all lined up as they were when I went to bed.

Suppose you want to initiate one of these “automagically restart everything after restart” restarts. As of a few weeks ago, I had it in my head that you have to write a small app that uses the Restart Manager APIs (e.g. RmStartSession and RmShutdown) to do this.

And then it hit me that the shutdown command must have support for doing this. And indeed, it has:

shutdown /g

Comments

BnayaA said:

Good post.

# August 14, 2011 4:44 PM

JasonC said:

Is there a way to get a list of all the "Registered Applications"?

# February 17, 2012 4:49 PM

xpclient said:

Yes install ARR Explorer (james-ross.co.uk/.../arr) and you will see a list of registered apps. Unfortunately, my most used app, Notepad, yet doesn't register for ARR.

# March 30, 2012 10:48 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: