skip to content

Why does a per-user autostart on Windows need no administrator rights, and why does it vanish when the user's profile is lost?

level: juniorimportance: should knowfreq 46%

answer

  1. it belongs to one account
  2. kept inside that user's profile
  3. registry hive file loaded at logon
  4. temporary profile is deleted

basics

~20 s

A per-user autostart sits in the current user's own registry hive and Startup folder, so it needs only that user's rights. Both are part of the profile, so a deleted or replaced profile takes the entry with it.

solid answer

~40 s

The current-user Run key lives in the user's own registry hive, the file `NTuser.dat`, which the system loads at logon; the per-user Startup folder is also part of that profile. Placing an entry there takes the rights of the user it is for, not an administrator's, and it runs each time that user signs in. Because both locations belong to the profile, a temporary profile (deleted at the end of each session) or a profile that is deleted and recreated takes the entry with it. A roaming profile is the exception: it is copied to a server share and downloaded to any computer the user signs in to.

go deeper

for a junior

Say that the entry sits in one user's profile, needs only that user's rights and disappears if the profile does.

for a middle

Explain that the current-user hive is the profile's NTuser.dat file loaded at logon, and that a temporary profile is deleted at session end.

for a senior

Bring up roaming profiles, where a re-image does not help because the server copy is downloaded again.

for a principal

Decide which profile types the estate uses, since profile type decides what a per-user trigger can keep and what a clean-up has to touch.

## Where a per-user autostart is kept Windows gives a user two places to start a program at their own sign-in: - **The current-user Run key.** The Run key makes a program run every time the user logs on. Its data is stored in the user's registry hive, which is the file `NTuser.dat`; the system loads it at logon and maps it to the current-user key. - **The user's Startup folder.** The user's Startup program group: the system starts these programs whenever the associated user logs on. The folder sits under that user's profile. Both are *per-user*: they fire for the account whose profile holds them, and for no other account on the same machine. ## Why it needs no privilege The current-user key is the user's own hive, not shared machine configuration. A process running as that user acts on that user's data. So the price of this trigger in rights is the user's own rights, which is the lowest price on the list, and that is what makes it the cheap choice. The documentation describes the keys as ones that can be set for the user or the machine; it does not state a particular right for the per-user case, so the point rests on the hive belonging to the user. Programs from the Run key are also not guaranteed to start promptly: the system may delay the Run key and Startup group programs to a time less likely to disturb the foreground user. ## What it survives and what it does not | Event | Per-user autostart | |---|---| | The user signs out and in | Runs again at each sign-in | | A reboot | Runs again at the next sign-in of that user | | A different user signs in | Does not run | | The profile is lost, deleted or replaced | Gone with the profile | | A temporary profile is issued | Deleted at the end of each session | | A re-image of the machine | Gone, unless a roaming profile restores it | A **temporary profile** is issued each time an error condition prevents the user's profile from loading and is deleted at the end of each session. A **mandatory profile** can be changed only by administrators, and changes users make to desktop settings are lost when they log off; the documentation says nothing more specific about registry entries, so treat it as a lever to test, not a guarantee. ## The roaming-profile exception A **roaming profile** is a copy of the local profile stored on a server share, downloaded to any computer a user logs onto and synchronised when the user logs off. If a per-user autostart lives in a roaming profile, a re-image of the laptop does not remove it: the server copy delivers it again at the next sign-in, to this machine or to another. ## Where the per-user class is weaker - **It needs a sign-in.** On a machine where nobody is signed in, a per-user autostart runs nothing; a service would. - **It is tied to one account.** It fires for the profile that holds it and for nobody else. - **It is ignored in Safe Mode by default.** The Run keys are ignored when the computer is started in Safe Mode by default, so the program does not run there by default. - **It cannot be timed.** The system does not guarantee how promptly Run key programs start, and may delay them and the Startup group programs to avoid disturbing the foreground user. Those weaknesses are the price paid for needing no privilege, and they explain why a more determined adversary also places a second trigger of another class. ## What it means for the clean-up 1. Find where the user's profile actually lives: local, roaming or mandatory. 2. Check each user profile on the machine, not only the account that raised the alert; a per-user entry fires only for its own user. 3. Cover the machine-wide places as well, because the cheap trigger often sits beside a more robust one. 4. For a roaming profile, clean the server copy or the re-image will be undone. Which rights the other classes need, and what they survive, is compared in the price-list material; this entry stays on the cheapest end of it.

  • Does a per-user autostart run for every account that signs in to the laptop?
    No. It fires only for the user whose profile holds it, so a clean-up has to check each profile on the machine as well as the account that raised the alert. The machine-wide Run key and the all-users Startup group are the locations that apply to every user.
  • What can an owner do beforehand to limit what a per-user autostart can keep?
    Choose the profile type. The documentation says a mandatory profile can be changed only by administrators and that changes users make to desktop settings are lost at logoff. It says nothing more specific about registry entries, so test the behaviour before relying on it as a control.

  • A per-user autostart survives a profile reset
  • It needs administrator rights, like a service
  • It runs for every account on the machine
  • A re-image always removes it, even from a roaming profile
  • The Startup folder is machine configuration, not part of the profile