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

How do I run Control Panel Applet as Administrator.
On Mon, 03 Jul 2006 23:19:11 -0400, Jean Cyr 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. :-(
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" wrote in message
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. :-(
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
Windows Vista
User login
Related topics
- Cannot access Docs & Settings folder
- Activation Error 0x800700D
- this beta is a joke?
- New Graphic Card on Old MoBo?
- Security on windowas vista
- ISO File
- Vista upgrade from XP SP2
- Code 0xC004F002
- No support for older GeForce?
- Creativelabs Webcam Instant works!
- Change default boot?
- Turtle Beach Santa Cruz Driver error
- any noticable improvments on the latest?
- PCMCIA Memory Card - SRAM Driver
- Posting Problems
- vista beta 2 installation
- New nVidia driver for Vista...
- Mouse and Keyboard Woes
- large drive
- its all green so far.
- Vista Memory requirements: Too much, way too much
- Error reported in Application Log
- Install Missing Driver Vista Beta 2 x86
- public preview/beta of vista?
- UAC and IE7
- Linksys WPC54G ver 1.2
- Egg timer on XP
- Vista Server - Many Problems
- Can't install Vista 5381, 5384, Longhorn Server 5381 and 538
- HELP! Aero vista beta 2 problems.
- Need help bad.
- ie7 frozen
- spyware programs with Vista
- Diskeeper 10 Professional now supports Vista 5384
- Parental Control - Block By content
- Office 07 Error