Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to always run a program as Administrator in Windows 10

📅 2018-Mar-26 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ administrator, windows ⬩ 📚 Archive

  When you first run a GUI program that requires Administrator privileges, Windows 10 will show a dialog prompting you to give it that privilege. Subsequently, that executable or shortcut gets the “Run as Administrator” privilege. Executables and shortcuts that have this privilege will get a shield (🛡️) icon added to the bottom-right of their icon.

However, if you run a command-line program that requires Administrator privileges, it will silently fail. Windows 10 will not show the dialog prompting you to give the program that privilege, like it did with GUI programs.

So, for command-line programs that need such Administrator privilege, right-click on their icon and choose Properties. Choose the Compatibility tab → Settings and enable the “Run this program as an administrator” setting and click OK. You will notice that the command-line program now gets a shield (🛡️) icon added at the bottom-right of its icon. You will now get prompted for administrator privileges when this command-line program is executed at the command prompt.


© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧