Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista security

Vista - How do I run Control Panel Applet as Administrator.

Reply
 
Old 07-03-2006   #1 (permalink)
Jean Cyr


 
 

How do I run Control Panel Applet as Administrator.

Ok, I have a control panel applet that has a legitimate need to run as
administrator. Via WMI it needs to write to settings to registry hive
HKLM for an associated service. When I run it under a normal
administrator account I get an 'Access Denied' error.

No problem, I'll just create a manifest and set the
requireAdministrator requirement as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity processorArchitecture="x86"
version="3.0.16.0" type="win32" name="myapp.cpl"/>
<description>My Application control panel applet</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
publicKeyToken="6595b64144ccf1df" language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator" uiAccess="true"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

Well, no dice! Now I get an error popup that reads 'Illegal value:
requested run level'!!! What gives? I expected the LUA to prompt me
about allowing elevation, but no such luck! Is this thing brain dead
or am I? There doesn't seem to be a way around this.
---------------------------------------------
Jean Cyr - Dillobits Software
jcyr@dillobits.com - http://www.dillobits.com

My System SpecsSystem Spec
Old 07-04-2006   #2 (permalink)
Jean Cyr


 
 

Re: How do I run Control Panel Applet as Administrator.

On Mon, 03 Jul 2006 23:19:11 -0400, Jean Cyr <jcyr@dillobits.com>
wrote:

>Well, no dice! Now I get an error popup that reads 'Illegal value:
>requested run level'!!! What gives? I expected the LUA to prompt me
>about allowing elevation, but no such luck! Is this thing brain dead
>or am I? There doesn't seem to be a way around this.


Follow up: Tried the CoCreateInstanceAsAdmin approach on the WMI
locator object. No joy... The object doesn't support elevation. As a
last ditch attempt to get past this roadblock and move on with further
debugging I tried creating a patch using the Compatibility
Administrator. Bump... doesn't elevate CPLs.

At this point development is dead in the water for Vista preparations.
Hope MS will see fit to clearing this up soon. :-(
My System SpecsSystem Spec
Old 07-05-2006   #3 (permalink)
Chris Altmann


 
 

Re: How do I run Control Panel Applet as Administrator.

IIRC, a cpl is just a DLL and runs in the control panel process, thus you
can't elevate it. You need to rewrite (or separate the admin parts) as an
exe or other external process that UAC can elevate.

"Jean Cyr" <jcyr@dillobits.com> wrote in message
news:5u7la21nev3qkrtgbs80v8artaiapbka5i@4ax.com...
> On Mon, 03 Jul 2006 23:19:11 -0400, Jean Cyr <jcyr@dillobits.com>
> wrote:
>
>>Well, no dice! Now I get an error popup that reads 'Illegal value:
>>requested run level'!!! What gives? I expected the LUA to prompt me
>>about allowing elevation, but no such luck! Is this thing brain dead
>>or am I? There doesn't seem to be a way around this.

>
> Follow up: Tried the CoCreateInstanceAsAdmin approach on the WMI
> locator object. No joy... The object doesn't support elevation. As a
> last ditch attempt to get past this roadblock and move on with further
> debugging I tried creating a patch using the Compatibility
> Administrator. Bump... doesn't elevate CPLs.
>
> At this point development is dead in the water for Vista preparations.
> Hope MS will see fit to clearing this up soon. :-(


My System SpecsSystem Spec
Old 07-06-2006   #4 (permalink)
Tony Hoyle


 
 

Re: How do I run Control Panel Applet as Administrator.

Chris Altmann wrote:
> IIRC, a cpl is just a DLL and runs in the control panel process, thus
> you can't elevate it. You need to rewrite (or separate the admin parts)
> as an exe or other external process that UAC can elevate.
>

There's an program called 'RunLegacyCPLElevated' that is essentially an
elevated rundll32 (you call it with the same parameters). I just put in
an elevate button that reruns the cpl using that.. it'll do for the
betas until MS put in a proper mechanism.

Tony
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Control panel applet missing Vista General
mouse applet missing from Control Panel Vista General
Control panel applet & chkdisk log Vista General
NVIDIA Control Panel Applet 1.3.7.37 Vista General
Color Management Applet in Control Panel Vista music pictures video


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46