Accounts Add Run as administrator to Context Menu of VBS Files in Windows 11


  • Staff
VBS_banner.png

Windows runs desktops apps and application files (ex: .bat, .cmd, .exe, and .msc file types) in user mode by default without elevated administrator rights unless it prompts you with UAC to run elevated (highest privileges).

When you use Run as administrator on a desktop app or application file, you are allowing it to run with full administrator access to everything on the computer. This means you are giving it special permissions to access restricted parts of the computer that would otherwise be off-limits. This could be a potential security risk if not a trusted app or application file, but sometimes "Run as administrator" is necessary for a trusted app or application file to run properly if it requires elevated rights for full access.

A .vbs file is a Virtual Basic script written in the VBScript scripting language. It contains code that can be executed within Windows via the Windows-based script host (Wscript.exe), to perform certain admin and processing functions.

This tutorial will show you how to add or remove the Run as administrator context menu item for .vbs files for all users in Windows 10 and Windows 11.


You must be signed in as an administrator to add, remove, and use the Run as administrator context menu for .vbs files.



EXAMPLE: "Run as administrator" context menu for VBS files

VBS_Run_as_administrator.png
VBS_Run_as_administrator-2.png



Here's How:

1 Do step 2 (add) or step 3 (remove) below for what you would like to do.

2 Add Run as administrator to Context Menu of VBS Files

A) Click/tap on the Download button below to download the file below, and go to step 4 below.​

Add_Run_as_administrator_to_VBS_context_menu.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.vbs]
@="VBSFile"

[HKEY_CLASSES_ROOT\VBSFile\Shell\runas]
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\VBSFile\Shell\runas\command]
@=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\
  00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,\
  53,00,63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,22,\
  00,25,00,31,00,22,00,20,00,25,00,2a,00,00,00

3 Remove Run as administrator from Context Menu of VBS Files

This is the default setting


A) Click/tap on the Download button below to download the file below, and go to step 4 below.​

Remove_Run_as_administrator_from_VBS_context_menu.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\VBSFile\Shell\runas]

4 Save the REG file to your desktop.

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

6 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

7 You can now delete the downloaded REG file if you like.


That's it,
Shawn Brink


 

Attachments

  • VBS.png
    VBS.png
    12.3 KB · Views: 9
  • Add_Run_as_administrator_to_VBS_context_menu.reg
    661 bytes · Views: 27
  • Remove_Run_as_administrator_from_VBS_context_menu.reg
    262 bytes · Views: 29
Last edited:

Latest Support Threads

Top Bottom