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

Copy the following contents to Notepad and make a .reg file. Let’s say script_runas.reg

Double-click on the file to apply the settings to the registry. Click Yes when prompted.

Windows Registry Editor Version 5.00



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


The hex codes in the above .reg file translate to the following command:

%SystemRoot%\System32\WScript.exe "%1" %*

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 Posts

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded in 2005.