Skip to content

Instantly share code, notes, and snippets.

@lockworld
Last active February 7, 2023 16:25
Show Gist options
  • Save lockworld/f7f6c14d83613d4d12ec4bc0259b3caf to your computer and use it in GitHub Desktop.
Save lockworld/f7f6c14d83613d4d12ec4bc0259b3caf to your computer and use it in GitHub Desktop.
Use caution when editing the registry! This can cause instability in your system and even render your OS inoperable.

To force any application to run as an administrator (Even, for example, when you open it by double-clicking on an associated file type), create a new registry entry in

\!h Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

This should be a string value with the name set to the path for the executable that you want to run as an administrator. The below example is for Visual Studio 2015:

\!h C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe

The value should be set to the following:

\!h ~ RUNASADMIN

Now, whenever you run this program, it will be run in administrator mode automatically.

Source: StackOverflow: Can you force Visual Studio to always run as an Administrator in Windows 8?

Go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

Open (or create) ShowSecondsInSystemClock (DWORD (32-bit) Value) and set the value to 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment