Control of UAC elevated status from batch

June 15, 2009 at 15:06:09
Specs: Windows Vista Ultimate SP2, x86/3GB
Hi, does anyone know if it's possible to run a program with elevated status (i.e. as if you had selected "Run As Administrator" from the GUI) but from a command line? I can't use runas /user:administrator because the administrator account is disabled. I don't want to disable UAC.

Also, is it possible to tell programmatically if a batch file is being run from an elevated account (e.g. by checking an environment variable.)

Thanks


See More: Control of UAC elevated status from batch

Report •


#1
June 17, 2009 at 08:31:59
does anyone know if it's possible to run a program with elevated status
This script will show a normal UAC GUI prompt for elevation, if I read the article right.

Also, is it possible to tell programmatically if a batch file is being run from an elevated account
I don't know of any application that would report on the script's available permissions.


Report •

#2
June 17, 2009 at 15:29:38
Thanks Razor, that's awesome. The Elevate PowerToy does
what I was asking, though I never imagined it would take so
many Registry mods, a batch file and a VB script to do such a
seemingly simple thing.

Report •

#3
June 17, 2009 at 15:50:29
Most/All of the registry changes aren't required, as they just add context menus.

Report •

Related Solutions


Ask Question