Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Windows Vista / Administration / May 2008

Tip: Looking for answers? Try searching our database.

Run As Administrator from vbScript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Santiago Bruni - 29 May 2008 13:18 GMT
I want to use the "Run As Administrator" functionality of Windows Vista
(UAC), from a vbScript to call any application.
It is possible?

Thanks.
Ramesh, MS-MVP - 29 May 2008 13:31 GMT
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/articles/185/1/VBScripts-and-UAC-elevation.html

Signature

Regards,

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

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

Thanks.
Santiago Bruni - 29 May 2008 19:53 GMT
Thanks Ramesh!!!
It is possible to pass through the same function User and Password of
Administrator to execute this application?

Regards.

> Yes. Here is a sample script!
>
[quoted text clipped - 13 lines]
>
> Thanks.
Ramesh, MS-MVP - 30 May 2008 03:57 GMT
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.

Signature

Regards,

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

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!
>
[quoted text clipped - 7 lines]
> VBScripts and UAC elevation:
> http://www.winhelponline.com/articles/185/1/VBScripts-and-UAC-elevation.html
DevilsPGD - 30 May 2008 06:48 GMT
>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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.