0

I googled this, and I couldn't find an answer. What's a command that you have to UAC elevation in cmd.exe to run?

3

2 Answers 2

3

There are several commands that can't be performed unless you're running in an elevated command prompt. For example, setting a network adapter to DHCP:

netsh interface ipv4 set address "Local Area Connection" dhcp

However, this will never invoke the UAC elevation dialog. You'll simply be notified that the command requires elevation:

C:\Users\Oliver>netsh interface ipv4 set address "Local Area Connection" dhcp
The requested operation requires elevation (Run as administrator).
1
  • Using a command that makes a permanent and system-wide change just to check something is a recipe for disaster: you can never predict and/or eliminate all the side effects. Apr 17, 2017 at 21:16
0

Another would be REG ADD to a registry key that you don’t have modify access to; e.g., anything (most things?) in HKEY_LOCAL_MACHINE (HKLM).

Not the answer you're looking for? Browse other questions tagged .