Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / February 2008



Tip: Looking for answers? Try searching our database.

Startup app, run as administrator

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hurricane_number_one@yahoo.com - 25 Feb 2008 21:12 GMT
I have a program that needs to be run on startup with administrator
privileges. How can this be done and work in Vista?  If I require the
application to run with administrator privileges and just create a
shortcut to it in the startup items, it never runs. I can't see any
other way to do this.  I don't want to have to prompt the user to
accept each time either.  How can I do this??
Bob Butler - 25 Feb 2008 21:24 GMT
>I have a program that needs to be run on startup with administrator
> privileges. How can this be done and work in Vista?  If I require the
> application to run with administrator privileges and just create a
> shortcut to it in the startup items, it never runs. I can't see any
> other way to do this.  I don't want to have to prompt the user to
> accept each time either.  How can I do this??

Look into making it a service
hurricane_number_one@yahoo.com - 26 Feb 2008 01:17 GMT
If I made it a service, how would I get it to run as an administrator?
Would I have to have the user go in and change the run as option, or
would I be able to programatically set it to run as an admin as long
as I had their windows password?
Thanks.

> <hurricane_number_...@yahoo.com> wrote in message
>
[quoted text clipped - 8 lines]
>
> Look into making it a service
MikeD - 26 Feb 2008 15:33 GMT
If I made it a service, how would I get it to run as an administrator?
Would I have to have the user go in and change the run as option, or
would I be able to programatically set it to run as an admin as long
as I had their windows password?

You'd have the service log on using administrator credentials. Take a look
in Services (the Log On tab).

Signature

Mike
Microsoft MVP Visual Basic

Bob Butler - 26 Feb 2008 16:11 GMT
> If I made it a service, how would I get it to run as an administrator?
> Would I have to have the user go in and change the run as option, or
> would I be able to programatically set it to run as an admin as long
> as I had their windows password?

as long as you know the admin password you can configure it using API calls
CreateService and/or ChangeServiceConfig

IIRC it can also be set using ADSI with
GetObject("WinNT://./<name>,Service")
 
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



©2009 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.