Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to let your app get admin priviledges on Vista

0 views
Skip to first unread message

Kid

unread,
Jul 4, 2009, 10:07:00 PM7/4/09
to

Hi

I found that RegOpenKeyEx will fail on Vista when the base path is
HKEY_LOCAL_MACHINE but my app need to check some key of driver.

Is there any api can ask admin priviledges when launching then I do
not need to click mouse right key and choose admin priviledges from
Vista pop-up menu ?

Thank you .

Pavel A.

unread,
Jul 5, 2009, 10:23:20 AM7/5/09
to

Yes there is (specify admin priviledges in the manifest) - but what if
you simply won't request _write_ access ?

-- pa

Volodymyr Shcherbyna

unread,
Jul 5, 2009, 1:14:29 PM7/5/09
to
Kid wrote:

I am not sure this is the right group for your question, the
microsoft.public.win32.programmer.kernel seems to be more suitable.
Regarding your question. At startup your program can check SID of user and
if it limited admin, you can propose to re-run it via runas (ShellExecute
or CreateProcess). But the Pavel's suggestion with manifest seems to be
more elegant.

--
Volodymyr M. Shcherbyna, blog: http://www.shcherbyna.com/
(This posting is provided "AS IS" with no warranties, and confers no rights)

0 new messages