Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Administration > Run As Administrator from vbScript

Reply
Thread Tools Display Modes

Run As Administrator from vbScript

 
 
Santiago Bruni
Guest
Posts: n/a

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

Thanks.
 
Reply With Quote
 
 
 
 
Ramesh, MS-MVP
Guest
Posts: n/a

 
      05-29-2008
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" <> wrote in message news:354D2163-7D84-484E-BE54-...
I want to use the "Run As Administrator" functionality of Windows Vista
(UAC), from a vbScript to call any application.
It is possible?

Thanks.
 
Reply With Quote
 
Santiago Bruni
Guest
Posts: n/a

 
      05-29-2008
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:

> 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" <> wrote in message news:354D2163-7D84-484E-BE54-...
> I want to use the "Run As Administrator" functionality of Windows Vista
> (UAC), from a vbScript to call any application.
> It is possible?
>
> Thanks.
>

 
Reply With Quote
 
Ramesh, MS-MVP
Guest
Posts: n/a

 
      05-30-2008
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" <> wrote in message news:046E6BD3-9327-46F0-ACA1-...
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:

> 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" <> wrote in message news:354D2163-7D84-484E-BE54-...
> I want to use the "Run As Administrator" functionality of Windows Vista
> (UAC), from a vbScript to call any application.
> It is possible?
>
> Thanks.
>

 
Reply With Quote
 
DevilsPGD
Guest
Posts: n/a

 
      05-30-2008
In message <046E6BD3-9327-46F0-ACA1-> Santiago
Bruni <> wrote:

>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.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows VBscript 5.6 DC Windows Vista Installation 8 06-18-2009 02:31 PM
vbscript and UAC prompt dak Windows Vista General Discussion 4 10-04-2008 10:28 PM
vbscript error chriskli21 Windows Vista Installation 10 05-23-2008 06:06 PM
Re: Vista and VBScript Alexander Suhovey Windows Vista General Discussion 0 12-22-2006 02:41 PM
What's Up With Vbscript.dll and Vista? John A. Gallagher Windows Vista General Discussion 0 12-16-2006 02:02 AM



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 51 52 53 54 55 56 57 58 59