Add Run as Administrator Context Menu Item for VBS and JS files

By default, Windows does not include the Run as Administrator option in the context menu for Vbscript (.VBS) and JScript (.JS) files. So, to run a script elevated, you either need to launch the script from elevated Command Prompt window, or use the VBScript self-elevation method as described in article How to Automatically Elevate a Vbscript to Run it as Administrator?

Besides that you can add the Run as Administrator option to the context menu so that you can run a script elevated from the right-click menu.

Add “Run as Administrator” Context Menu option for VBScript and JScript files

Download script_runas.reg and save to Desktop. Right-click on the file and choose Merge. Click Yes when prompted.

This .reg file adds the runas command for VBSFile and JSFile ProgIDs. The registry keys are located here:

HKEY_CLASSES_ROOT\VBSFile\Shell\runas
HKEY_CLASSES_ROOT\JSFile\Shell\runas

Now, when you right-click a VBScript or JavaScript file, you’ll have an option to run it as administrator.

add run as administrator context menu for vbs files





Related Articles

Open an elevated Command Prompt from the folder context menu

Automatically elevate a Vbscript to run it as administrator (using “runas”)

Register DLLs (elevated) using the context menu

Add “Edit HOSTS file” option in the context menu

About the author

Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.