How to always force cmd/command prompt and Visual Studio to run as Administrator

Copy the following text to a “runasadmin.reg” file on your machine.  Double-click it and confirm that the file will be merged into the registry.

The following inserts the default install location for Visual Studio 2015, but can be modified if the install directory is different or you’re running a different version of Visual Studio.

 
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Windows\\System32\\cmd.exe"="~ RUNASADMIN"
"C:\\Windows\\SysWOW64\\cmd.exe"="~ RUNASADMIN"
"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe"="~ RUNASADMIN"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Windows\\System32\\cmd.exe"="~ RUNASADMIN"
"C:\\Windows\\SysWOW64\\cmd.exe"="~ RUNASADMIN"
"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe"="~ RUNASADMIN"

 

This entry was posted on Saturday, July 9th, 2016 at 10:34 am and is filed under Windows. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.