익명 11:32

What's the purpose of 'run as administrator' when using cmd or powershell?

What's the purpose of 'run as administrator' when using cmd or powershell?

Why should I run as administrator every time when I use cmd or powershell? What does it do? Does it just give you more permission than the normal cmd that does not run as administrator?



Top Answer/Comment:

Why should I run as administrator every time when I use cmd or powershell?

You really should not.

Why does one need Admin rights at all? To change certain system settings and to access/edit certain files. Or, to take it very literally: To perform administrative tasks. This is, by definition, not what you normally do on your PC.

Let’s say you want to change your computer’s IP address on the local network. This requires Admin rights. Or maybe you want to add a new user account to your PC. So yes, it does give you more permissions. A lot more.

On the other hand, opening and editing a Word document, then printing it, does not require Admin rights. There are even some operations that should never be performed with Admin rights, like browsing the web. The separation of rights is a critical security feature.

When you use the Windows graphical user interface, requesting and getting Admin rights (elevated permissions) is often intuitive and you’ll be prompted when needed. On the command line, this is different. Take a look at this example:

C:\Users\Daniel>netsh interface ipv4 set address "Wi-Fi" static 10.0.0.9 255.255.255.0 10.0.0.1
The requested operation requires elevation (Run as administrator).

I couldn’t change the Wi-Fi adapter’s IP address! Instead of prompting for elevation, the operation simply failed. I would have to re-launch Command Prompt as Admin myself to actually do this. The elevated Command Prompt would then run what I type in elevated, like netsh in this example. With PowerShell it’s also important that many operations are performed by the shell itself rather than a dedicated program like netsh.

This is why sometimes you need to launch PowerShell or Command Prompt as Admin.


The rule of thumb is that you would never run something as Admin unless you determined it’s absolutely necessary. You should be especially suspicious of downloaded software and copy-pasted snippets for PowerShell or Command Prompt. In the worst case, they could destroy your system and your data.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다