Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Vista Newsgroups > Vista account administration

Run As Administrator from vbScript

Closed Thread
 
Thread Tools Display Modes
Old 05-29-2008   #1 (permalink)
Santiago Bruni
Guest


 

Run As Administrator from vbScript

I want to use the "Run As Administrator" functionality of Windows Vista
(UAC), from a vbScript to call any application.
It is possible?

Thanks.
Old 05-29-2008   #2 (permalink)
Ramesh, MS-MVP
Guest


 

Re: Run As Administrator from vbScript

Yes. Here is a sample script!

- - -
Set objSh = CreateObject("Shell.Application")
objSh.ShellExecute "notepad.exe", "" , "", "runas", 1
- - -

See also:

VBScripts and UAC elevation:
http://www.winhelponline.com/article...elevation.html

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
The Winhelponline Blog: http://www.winhelponline.com/blog
Windows® Troubleshooting: http://www.winhelponline.com

"Santiago Bruni" <SantiagoBruni@xxxxxx> wrote in message news:354D2163-7D84-484E-BE54-81B9319B9094@xxxxxx
I want to use the "Run As Administrator" functionality of Windows Vista
(UAC), from a vbScript to call any application.
It is possible?

Thanks.
Old 05-29-2008   #3 (permalink)
Santiago Bruni
Guest


 

Re: Run As Administrator from vbScript

Thanks Ramesh!!!
It is possible to pass through the same function User and Password of
Administrator to execute this application?

Regards.

"Ramesh, MS-MVP" wrote:
Quote:

> Yes. Here is a sample script!
>
> - - -
> Set objSh = CreateObject("Shell.Application")
> objSh.ShellExecute "notepad.exe", "" , "", "runas", 1
> - - -
>
> See also:
>
> VBScripts and UAC elevation:
> http://www.winhelponline.com/article...elevation.html
>
> --
> Regards,
>
> Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
> The Winhelponline Blog: http://www.winhelponline.com/blog
> Windows® Troubleshooting: http://www.winhelponline.com
>
> "Santiago Bruni" <SantiagoBruni@xxxxxx> wrote in message news:354D2163-7D84-484E-BE54-81B9319B9094@xxxxxx
> I want to use the "Run As Administrator" functionality of Windows Vista
> (UAC), from a vbScript to call any application.
> It is possible?
>
> Thanks.
>
Old 05-29-2008   #4 (permalink)
Ramesh, MS-MVP
Guest


 

Re: Run As Administrator from vbScript

Nope. I don't think it's possible, especially in the UAC dialog. Perhaps you can repost this question in WSH groups for any alternate solutions.

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
The Winhelponline Blog: http://www.winhelponline.com/blog
Windows® Troubleshooting: http://www.winhelponline.com

"Santiago Bruni" <SantiagoBruni@xxxxxx> wrote in message news:046E6BD3-9327-46F0-ACA1-6CB71F4F9AE7@xxxxxx
Thanks Ramesh!!!
It is possible to pass through the same function User and Password of
Administrator to execute this application?

Regards.

"Ramesh, MS-MVP" wrote:
Quote:

> Yes. Here is a sample script!
>
> - - -
> Set objSh = CreateObject("Shell.Application")
> objSh.ShellExecute "notepad.exe", "" , "", "runas", 1
> - - -
>
> See also:
>
> VBScripts and UAC elevation:
> http://www.winhelponline.com/article...elevation.html
>
> --
> Regards,
>
> Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
> The Winhelponline Blog: http://www.winhelponline.com/blog
> Windows® Troubleshooting: http://www.winhelponline.com
>
> "Santiago Bruni" <SantiagoBruni@xxxxxx> wrote in message news:354D2163-7D84-484E-BE54-81B9319B9094@xxxxxx
> I want to use the "Run As Administrator" functionality of Windows Vista
> (UAC), from a vbScript to call any application.
> It is possible?
>
> Thanks.
>
Old 05-30-2008   #5 (permalink)
DevilsPGD
Guest


 

Re: Run As Administrator from vbScript

In message <046E6BD3-9327-46F0-ACA1-6CB71F4F9AE7@xxxxxx> Santiago
Bruni <SantiagoBruni@xxxxxx> wrote:
Quote:

>It is possible to pass through the same function User and Password of
>Administrator to execute this application?
Are you trying to bypass the UAC prompt, or run an application with
administrative privileges after a UAC prompt?

If you can handle waiting a minute or two, you can have a scheduled task
that launches a script to look for an external trigger (existence of a
temporary file would be the easiest) that kicks off the elevated
process.

If you wanted something more real-time and don't need to interact with
the desktop, you could write a service to accomplish your goal.
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Account 'NAMED' Administrator vs. 'administrator rights' question FireBrick Vista installation & setup 1 4 Weeks Ago 08:02 AM
VBScript That Changes Its Identity Joseph Morales VB Script 8 07-17-2008 12:21 PM
Re: vbscript pause Chongy VB Script 3 05-31-2008 09:09 AM
vbscript and HTA help Daz VB Script 10 05-31-2008 12:22 AM
If I am logged in as administrator why don't programs run as administrator vista? RoaringLambs Vista General 6 06-13-2007 06:17 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50