Run as Administrator - Add or Remove from Context Menu in Windows 7

How to Add or Remove "Run as Administrator" from Context Menu in Windows 7 and Windows 8

   Information
This will show you how to either remove or restore Run as administrator from the context menu of the default BAT, CMD, CPL, EXE, and MSC application files for all users in Windows 7 and Windows 8.

You must be logged in as an administrator to be able to do the steps in this tutorial.


EXAMPLE: "Run as administrator" in Context Menu of Application Files
Example.jpg

Windows8.jpg

Windows_8.1_Update.jpg


Here's How:
1. Do step 2 or 3 below for what you would like to do.

2. To Restore "Run as administrator" to the Context Menu
NOTE: This is the default setting.
A) Click/tap on the Download button below to download the file below, and go to step 4 below.
Restore_Run_as_administrator.reg

Download


3. To Remove "Run as administrator" from the Context Menu
A) Click/tap on the Download button below to download the file below, and go to step 4 below.
Remove_Run_as_administrator.reg

Download


4. Save the .reg file to your desktop.

5. Double click/tap on the .reg file to merge it.

6. If prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve merging.

7. When finished, you can delete the .reg file if you like.
That's it,
Shawn





 

Attachments

Last edited:
Shaun this tut is great. I am not a beginner but I do not know how to determine the hex number after "@=hex(2)" in the file Restore_Run_as_administrator.reg
I would like to add the extensions JPG, DOC, DOCX, RAR & ZIP, how do I determine the hex numbers for these?
I noticed these lines were different for EXE, is this the only case or are there others that are similar
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x32
Hello execcese, and welcome to Seven Forums.

Unfortunately, adding "Run as administrator" to those file types' context menu would be pointless since they are not application type files and would not work. :(
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Last edited by a moderator:

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x32
With regards to my previous reply you may have to use the file Properties then Security tab to enable permissions for the Administrator.
With regards to my original query. When I double click on a JPG file it opens in Irfan View because that is what I have set "Open with" to in Properties. Are you saying adding "Run as administrator" to the context menu cannot be done or it will not work?
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x32
execcese,

"Run as administrator" can only be used on executable application files. A JPG is an image file and not an application type file.

For what you want, you could use OPTION FIVE in the tutorial below to set the .exe file of Irfan View to always Run this program as an administrator. This way when you open the JPG file, it will open with an elevated (run as administrator) Irfan View.
http://www.sevenforums.com/tutorials/11841-run-administrator.html
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Many thanks Brink for this useful information.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x32
You're most welcome execcese. :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
hey thnks .. the file "restore run as adm .." is excellent ..!!
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
hp
OS
32 bit windows 7
CPU
amd athlon
Memory
2 gb
Hard Drives
160 gb
Antivirus
avast
I realize this post is quite old, but wanted to 'fix' the erroneous assumption that this only works for certain types. It's not actually 'executing' the file you're trying to 'open'. It's executing the program used to view/use/edit the file as an admin. So yes it can work for ANY file type. I was looking to see if someone had made a program that can do this instead of having to manually go through and add the necessary reg entries, and stumbled on this post. Just wanted to clear that up.
 

My Computer

Computer type
PC/Desktop
OS
IN
check running status? (eg is notepad running as admin)

I realize this post is quite old, but wanted to 'fix' the erroneous assumption that this only works for certain types. It's not actually 'executing' the file you're trying to 'open'. It's executing the program used to view/use/edit the file as an admin. So yes it can work for ANY file type. I was looking to see if someone had made a program that can do this instead of having to manually go through and add the necessary reg entries, and stumbled on this post. Just wanted to clear that up.

like brink said?

for everyone like me that just wanted to know how, the reg removes the offending runas subkeys
from the related filetypes...

; For .bat file extention
[-HKEY_CLASSES_ROOT\batfile\shell\runas]


; For .cmd file extention
[-HKEY_CLASSES_ROOT\cmdfile\shell\runas]


; For .cpl file extention
[-HKEY_CLASSES_ROOT\cplfile\shell\runas]


; For .exe file extention
[-HKEY_CLASSES_ROOT\exefile\shell\runas]


; For .msc file extention
[-HKEY_CLASSES_ROOT\mscfile\shell\RunAs]

I used to have some option to always run as admin, not sure if currently implemented.. can we test this, maybe by a flag in taskman, or a cmd, to see the active privileges? (if yes, HOW?!)

On a sidenote, does anyone know if a custom stringLabel can be added for shellextension context-menu entries?

I've analysed the shex for NVIDIA (I'd like to change the "Run with gfx" option to "Run with GFX")
I've looked at the dll and it's exported methods, and searched {a copy of} nvui.dll for the string "run ", but nothing is found.


grrr :banghead:
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 Ultimate 64bit
CPU
2.2
Memory
8Gb
Graphics Card(s)
NVIDIA
Screen Resolution
1280/762
Mouse
built in pad || iphone || MS wireless
Internet Speed
100MB
Antivirus
Avast
Browser
Chrome, Chrome portable
why I can not download the reg files

- - - Updated - - -

when I click download button, this page shows.

Hello, and welcome to Seven Forums. :-)

It looks like you were not logged in to the site at the time you tried to download.

Are you able to now?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Back
Top