Link to home
Start Free TrialLog in
Avatar of spunkies
spunkiesFlag for Denmark

asked on

Start non-elevated applications from elevated script

Hi all

I need to be able to run an application from a elevated script. How do I do this??

Right now, I'm using the script below, but this doesn't escape the elevation set by the UAC in Vista...

Thanks in advance!
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """" & Property("CustomActionData") & """",4,False
Set WshShell = Nothing

Open in new window

Avatar of RobSampson
RobSampson
Flag of Australia image

Hi, you can try using the Elevate.exe PowerToy for Vista to run your script:
elevate cscript MyScript.vbs

It is available here:
http://technet.microsoft.com/en-us/magazine/2008.06.elevation.aspx

Regards,

Rob.
ASKER CERTIFIED SOLUTION
Avatar of spunkies
spunkies
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi, I'm sorry, I misunderstood the question. I thought you wanted to start off as a normal user, and run the script as an administrator.  But you're looking at doing this the other way round, by starting with an elevated prompt, and running the command as a normal user.

I don't that's immediately possible. What you've found is probably the best workaround for this situation.

Regards,

Rob.
Avatar of spunkies

ASKER

Hi Rob

That's okay - thanks anyways! :-)