Create exe with "Run as Administrator"

Mar 9, 2013 at 11:03 AM
Edited Mar 9, 2013 at 11:04 AM
Hi . I remember in C# we put this command and that will force the .exe file to be run as administrator , I wonder that could happen in PS2EXE .

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
May 10, 2013 at 1:17 AM
Edited May 10, 2013 at 2:14 AM
This would be a fantastic addition.
With the .net 3.5 compiler, you can pass a manifest file which would include the line you specified (/win32manifest:<file>). I haven't figured out a way to do it with 2.0 however, my C# knowledge is very limited.

Using MT.exe (part of .NET Framework 2.0 Software Development Kit (SDK) ) you can edit the existing manifest.

Rename your ps2exe compiled EXE to "ExeName.exe". Then copy the below code into a text editor and save it as ExeName.exe.manifest within the same folder.
<?xml version="1.0" encoding="utf-8" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity version="" 
      type="win32" />
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <requestedExecutionLevel level="requireAdministrator" />
Then run:
mt.exe -manifest ExeName.exe.manifest -outputresource:ExeName.exe;#1