A Windows registry path that defines the command used when an executable is run with the runas shell verb. It points the shell to the elevated launch command for .exe files, which is part of the User Account Control and admin consent path.
What this registry path controls
HKCU\Software\Classes\exefile\shell\runas\command is the per-user registry location Windows consults when an executable is launched with the runas shell verb. In practice, it helps define how the shell invokes elevated execution for .exe files, so it sits directly on the path between a normal launch request and a consented administrative launch.
Because it lives under HKCU, the setting is user-scoped rather than machine-wide. That makes it important in environments where user profile state, shell associations, and elevation prompts are expected to behave consistently across endpoints, especially on shared workstations or systems with local administrator pressure.
Why it matters for elevation behavior
This registry path influences the trust boundary around runas. If it is altered, Windows may hand elevated execution to a different command path than administrators expect, which can change how consent prompts, helper processes, or launch arguments are handled. That makes it a meaningful control point for endpoint hardening and for understanding how admin elevation is actually implemented.
It is also part of the broader endpoint privilege model: if local users can modify related shell state or if endpoint baselines drift, the elevation path can become inconsistent. On managed systems, the practical question is not just whether elevation works, but whether it works through the approved command sequence and with the expected guardrails.
For broader context on reducing local admin exposure and tightening elevation pathways, see Endpoint Privilege Management Guide.
Common abuse and failure modes
Threats arise when an attacker or an over-permissive user can modify shell class settings to redirect execution, interfere with expected consent behavior, or establish persistence through user-level registry changes. Registry-based launch paths are attractive because they can blend into normal Windows behavior and are often only noticed when elevation begins behaving oddly.
Failure can also be operational rather than malicious. Broken associations, hardened profiles, migration artifacts, or conflicting software can cause runas launches to fail, misroute, or prompt inconsistently. In tightly controlled estates, even a small change in this value can create confusing support issues because the symptom appears at the shell layer while the root cause is in registry state.
How administrators verify and harden it
Practitioners should treat this value as part of endpoint baseline validation. Verify the command path on representative systems, compare it with the expected Windows default, and check whether the key is consistent across standard-user and administrative profiles. If the value differs unexpectedly, inspect whether software deployment, profile tools, or local tampering introduced the change.
Hardening usually comes from protecting the surrounding elevation model rather than relying on this single key. Reduce local administrator rights, monitor for registry changes to shell verbs and class associations, and use controlled elevation workflows so that users do not depend on ad hoc shell behavior. Where possible, pair baseline checks with change control and endpoint integrity monitoring so that a silent registry edit is visible quickly.
When investigation is needed, the most useful questions are whether the setting still points to the expected elevation command, whether the system is honoring the intended UAC path, and whether anything else on the endpoint is overriding shell execution behavior.
Risk and Threat Considerations
This registry path is risky because it sits on a user-controlled part of the Windows elevation chain. If an attacker can alter it, they may be able to redirect elevated launches, influence how consented execution is brokered, or create persistence that looks like ordinary shell behavior rather than an obvious startup artefact.
Failure mechanism: Registry modification changes the command Windows uses for the runas verb, so an attacker or misconfiguration can replace the intended elevation target with a different executable or wrapper.
Impact: The result can be privilege abuse, deceptive elevation, broken admin workflows, or delayed detection because the change is stored in a location many teams do not monitor as closely as services or scheduled tasks.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AC-6 — Least Privilege | This registry path affects elevated execution, which is governed by privilege limitation. |
| CM-5 — Access Restrictions for Change | Unexpected edits to shell command registration are configuration changes that need control. | |
| SI-7 — Software, Firmware, and Information Integrity | Tampered runas command resolution can indicate integrity loss in endpoint execution behavior. | |
| Recommendation — Restrict elevation paths so only approved users can invoke administrative execution. Limit who can modify shell association and registry settings on endpoints. Monitor endpoint integrity for unauthorized changes to elevation-related registry values. | ||
| CIS Controls v8 | 5 — Account Management | The setting directly affects how privileged execution is obtained on endpoints. |
| 8 — Audit Log Management | Changes to elevation-related registry values should be detectable through logging and review. | |
| Recommendation — Reduce standing admin access so elevation paths are used only when needed. Log and review registry changes tied to shell verbs and privilege escalation. | ||
Practitioner Guidance
What to watch for: Treat unexpected changes to shell class associations as a sign of endpoint compromise or configuration drift. This is especially important on systems where users routinely request elevation, because a subtle registry change can have outsized effects on privilege boundaries.
Governance implication: Own this setting as part of endpoint security baseline management, not as an isolated registry curiosity. The practical control objective is to keep elevation behavior predictable, auditable, and resistant to local tampering.
Practitioner takeaway: If runas behavior changes without an approved software change, investigate the registry state first and treat it as a potential privilege-path alteration.
Related resources from NHI Mgmt Group
- What breaks when a command parser cannot see shell builtins like cd and export?
- What breaks when third-party remote support software is exposed to command injection and privileged access is not tightly controlled?
- How should PHP teams prevent command injection when application input reaches shell commands?
- Why does command injection create such high risk when applications use eval, exec, or shell-based commands?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 9, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org