Results 1 to 20 of 20

Thread: Marking your exe for Request to Run as Administrator in Vista

Threaded View

  1. #1

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Marking your exe for Request to Run as Administrator in Vista

    I have been all over the Internet and there is nothing that explicitly tells you how to mark your file to "Run As Administrator". Everyone uses the buzz words but no one states exactly how to do it, Especially for VB exe's.

    I will give you a quick lesson on how it can be done with a little work. Since VB handles resource information differently than other languages such a C++ you can forget about using VB's resource editor on the exe. In my procedure you will need the help of a the program "Resource Hacker" by Angus Johnson http://www.angusj.com/resourcehacker/

    The procedure is as follows:

    1 - Open the exe in the Resource Hacker
    2 - Go to Action->Add a New Resource
    3 - Select any text file. it really doesn't matter for you are going to delete the information anyway. So choose a small one...
    4 - Use the following entries to fill in the New Resource box

    Resource Type - 24
    Resource Name - 1
    Resource Language - 3081

    4 - Select your new resource from the list and Replace whatever is in the language (3081) with a copy the XML script (Below) then compile the script and save back to the original exe. That's It!!!. Your exe is now marked to request to run as administrator on Vista. You will know this worked by the shield that Vista places on your applications icons.

    Don't forget to change the marker EXENAME in the XML script to the same name as the exe you are marking or it won't work!!!
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
        <assemblyIdentity version="1.0.0.0"
    	processorArchitecture="X86"
    	name="EXENAME"
    	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>
    Last edited by randem; Aug 5th, 2007 at 07:38 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width