Registry data refreshed from vendors: Last vendor change detected: 5 Dec 2026Next refresh: 1st of the monthApp v1.4.0 (5 Dec 2026): Cleanup or tattoo: see what stays behind after a GPO is removed. Release notes
Microsoft · Windows

Run and RunOnce keys: programs that start at sign-in

Each value in a Run key is a command line that Windows starts every time a user signs in. RunOnce entries start once and are then deleted.

Verified · 2026-12-05 Machine and user Windows 11Windows Server 2025Windows Server 2022Windows Server 2019Windows Server 2016

Where it lives

  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
  • HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  • HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

Values

NameTypeData and meaningDefault
<any name>REG_SZ or REG_EXPAND_SZcommand line Program and arguments to start

In plain English

  • HKLM keys run for every user who signs in; HKCU keys run only for that user.
  • The value name is any label; the data is the command line (REG_SZ or REG_EXPAND_SZ).
  • RunOnce values are deleted before the command runs. Prefix the name with ! to delete it only after the command succeeds, or * to run it in Safe Mode too.

Run keys are a classic persistence location for malware, so they're the first place to look on a compromised machine. Sysinternals Autoruns shows them with every other autostart location.

RestartTakes effect at the next sign-in.
RiskAny entry here runs with the user's rights at every sign-in. Review them during incident response.

How to configure it

List every Run and RunOnce entry on a machine

PowerShell

'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce',
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce' |
  ForEach-Object { Get-ItemProperty $_ -ErrorAction SilentlyContinue | Select-Object * -ExcludeProperty PS* | Add-Member -NotePropertyName Key -NotePropertyValue $_ -PassThru }

Official sources

Verified Confirmed automatically on the cited source.

Startup, Run keys and servicesSecurity hardening