SetupComplete.cmd & Related Registry Values

Ever wonder what triggers the SetupComplete.cmd file after Windows Installs / Windows Upgrades? It's actually just a couple of registry values.

When you run an upgrade, you can use the postoobe switch to set that value to a different location, which is what ConfigMgr does to use it's own custom SetupComplete.cmd file.

Lets now consider the unsupported..

Knowing this, you can hijack those values for other things, like an app install, or running any command line you'd like at the next startup of the computer, before a user can logon. Sure there are scheduled tasks you could create, or run keys, but isn't it fun to know you have other methods, and this will prevent the user from logging in until it's completed.

In this example I've created a simple command file and placed in c:\windows\temp called PreLogon.cmd. I've updated those two registry values.

At the next reboot:

Wasn't that fun? At least interesting if nothing else to understand how it works.

To understand more about the SetupComplete & SetupRollback, check out my other posts by searching those terms.

1 thought on “SetupComplete.cmd & Related Registry Values”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.