How do I create a manifest file to launch application with admin privileges?

You don’t actually create the manifest file in VB. A Windows application manifest is a standard text document, formatted as XML. You can create it in Notepad and save it with the appropriate file name in your application’s directory (YourAppName.exe.manifest). Microsoft has more information available here: Application Manifests. It even includes a sample manifest that … Read more

How to prevent Vista from requiring elevation on patch.exe?

The problem is that your application does not contain an assembly manifest with a requestedExectutionLevel. Background All correctly written Windows applications are required to have an assembly manifest. And starting in 2006 one of the elements you’re required to have is a requestedExecutionLevel that specifies if your application can only function if the user is … Read more

Correct way to deal with UAC in C#

This is fairly easy. Put a shield icon on the button that saves changes to the configuration file, instead of the menu item. This follows the Windows behavior of not requesting UAC permissions until the last moment. The button actually will launch your executable again as administrator with a special command line (that you decide) … Read more

How to add manifest info into delphi project

Here are some links Delphi and Windows Vista User Account Control Vista UAC Manifest Here are the steps: Create XML file with following content: <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?> <assembly xmlns=”urn:schemas-microsoft-com:asm.v1″ manifestVersion=”1.0″> <assemblyIdentity version=”1.1.1.1″ processorArchitecture=”X86″ name=”YourApplicationExeName” type=”win32″/> <description>elevate execution level</description> <trustInfo xmlns=”urn:schemas-microsoft-com:asm.v2″> <security> <requestedPrivileges> <requestedExecutionLevel level=”requireAdministrator” uiAccess=”false”/> </requestedPrivileges> </security> </trustInfo> </assembly> Name this XML file as … Read more

Giving application elevated UAC

You don’t need to meddle with all that to make sure that your application always runs with elevated privileges. You can simply add an application manifest which instructs Windows to run your app elevated, and the UAC prompt will appear without you needing to write a single line of code. There’s a related question with … Read more

Disabling UAC programmatically

Set the EnableLUA DWORD value in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System to 0 and reboot. this will disable UAC without a problem, i would do it to all your users, with or without permission is up to you, because the vista UAC is so horrid that i do believe the less people that have it on the better (in … Read more

How to run application which requires admin rights from one that doesn’t have them [closed]

Real problem: (from Wikipedia: http://en.wikipedia.org/wiki/User_Account_Control) An executable that is marked as “requireAdministrator” in its manifest cannot be started from a non-elevated process using CreateProcess(). Instead, ERROR_ELEVATION_REQUIRED will be returned. ShellExecute() or ShellExecuteEx() must be used instead. (BTW, ERROR_ELEVATION_REQUIRED error == 740) Solution: (same site) In a native Win32 application the same “runas” verb can be … Read more

How to call LogonUser() to get a non-restricted full token inside a Windows Service with UAC enabled?

You can get an unfiltered token from LogonUser() by using the LOGON32_LOGON_BATCH option instead of the LOGON32_LOGON_INTERACTIVE option. There is some sample code in this answer which shows the use of LOGON32_LOGON_BATCH and the LogonUser() function to obtain an administrative token. Addendum: If you have SeTcbPrivilege, you have another option: you can use LOGON32_LOGON_INTERACTIVE when … Read more