• Welcome to Theos PowerBasic Museum 2017.

How to elevate a process to admin under Win 7

Started by Eros Olmi, January 14, 2010, 01:11:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Eros Olmi

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
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

José Roca

 
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

Eros Olmi

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
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB