J
Jean Cyr
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.
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.