In Windows 7 and Windows Vista where there is UAC (User Account Control) built-in, users may need to run certain applications or programs as administrator to gain privileged full administrator rights. For most file types, such as .EXE or .COM, Windows 7 and Vista, the operating system automatically include a contextual command option called “Run as Administrator” in the right click menu. However, that’s not the case for VBScript (.VBS) and JavaScript (.JS) scripting files.

Users who need to run .VBS or .JS script files with elevated administrator privileges can use the following registry hack to add the “Run as Administrator” right click menu item to the .VBS and .JS file’s context menu.

Download and merge (run) the following registry registration entries files in order to create necessary registry keys to display and Run as Administrator option on .VBS or .JS right click menu respectively.

For VBScript (.vbs): vbs-runas.reg
For JavaScript (.js): js-runas.reg

What’s the registry files above do is adding the required registry key named runas for VBSFile and JSFile ProgIDs at the following location:

HKEY_CLASSES_ROOT\VBSFile\Shell\runas

or,

HKEY_CLASSES_ROOT\JSFile\Shell\runas

So, to undo the process and remove the Run as Administrator for VBSFile and JSFile, just remove the above registry key.

Related Posts