Vista’s UAC: How to elevate scripts (VBScript and JScript)

Stefan Krueger of the InstallSite Blog links to two posts describing how to elevate scripts, that is to run them with administrator rights. One has an example for VBScript and the other one is for JScript. Both solutions use a wrapper script that launches the main script. Note that they don't circumvent UAC. If an admin is running this script, she will get the UAC prompt if this feature is not disabled. Under Windows XP, you only had the problem of running scripts with sufficient privileges, while under Vista you have the additional problem of telling UAC that a script will need admin privileges. So you have to take two lines of defense now before actually getting things done.

Profile gravatar of Michael Pietroforte

Michael Pietroforte

Michael Pietroforte is the founder and editor of 4sysops. He is a Microsoft Most Valuable Professional (MVP) with more than 30 years of experience in IT management and system administration.
Profile gravatar of Michael Pietroforte

Take part in our competition and win $100!

Related Posts

  1. avatar
    Leonardo 10 years ago

    On my personal machine, I have the prompting off but UAC still on. IE still runs in protected mode and applications still run with user credentials...

    I figure, what the hell: Never had a virus/trojan/spyware problem all these years, why start now?

  2. Profile gravatar of Michael Pietroforte
    Michael Pietroforte 10 years ago

    You’re right it makes sense to just disable UAC prompting. However, I am still undecided if we shall turn off UAC prompting by default in our network. UAC without these nagging prompts is certainly a security improvement.


Leave a reply

Your email address will not be published. Required fields are marked *



Please ask IT administration questions in the forum. Any other messages are welcome.

© 4sysops 2006 - 2017
Do NOT follow this link or you will be banned from the site!

Log in with your credentials


Forgot your details?

Create Account