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>




Reply With Quote