Theos PowerBasic Museum 2017

Archive => Discussion - Legacy Software (PBWIN 9.0+/PBCC 5.0+) => Topic started by: Eros Olmi on January 14, 2010, 01:11:13 PM

Title: How to elevate a process to admin under Win 7
Post by: Eros Olmi on January 14, 2010, 01:11:13 PM
Hi all.

I need to elevate a process to admin privilege under Windows Vista and Windows 7.
I do not need the process always be admin but only in certain circumstances.

Is it possible to do it via API and/or de-activate it when done?

Thanks a lot
Eros
Title: Re: How to elevate a process to admin under Win 7
Post by: José Roca on January 14, 2010, 03:18:56 PM
 
I don't think that a running program can change its administration privileges at will.

I have found an interesting article about the subject: http://msdn.microsoft.com/en-us/magazine/cc163486.aspx
Title: Re: How to elevate a process to admin under Win 7
Post by: Eros Olmi on January 14, 2010, 03:33:45 PM
Thanks a lot.
It is what I suspected googling around but I wanted just to ask some guru here.

The needs is about thinBasic programming language and the fact that some script could need admin level.
I think I will solve the problem adding a pre-parsing command like #ElevateAdmin. So if parser will find that command it will instruct thinBasic to shell the process asking for admin privileges.

Thanks
Eros