❓ [Question]Force Run As Admin

Posts 1–10 of 10 · Page 1 of 1
❓ [Question]Force Run As Admin
Hey how do you guys make the program administrator mandatory.
So the program always needs to be run as admin.
It is possible, You will have to edit the Manifest File,

Give me 5 mins or So, I will make a tutorial

_______________________________________



"asInvoker" - Current User Level
"highestAvailable" - Highest Current User Has
"requireAdministrator" - Require Admin
I want to know aswell. thanks gen
Not a problem, I am making a full tutorial, as I said It will be in the vb section soon.

Edit: Actually No need to
|-|3|_][({}PT3R12

added a screenshot

In either case

Show All files in your Solutions Explorer

Navigate to the Bin Folder ----> Debug ----> Applicationname.Vshost.exe.Manifest File

Double Click it and

add this code

[php]
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0"
xmlns="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</asmv1:assembly>
[/php]

Replacing it with the existing code

or

Use the existing code

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" name="MyApplication.app"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
The information is as follows

requireAdministrator:
highestAvailable:
asInvoker: Vb.net Default

So for this particular case it would be

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" name="MyApplication.app"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <requestedExecutionLevel level="requireAdministrator:" uiAccess="false"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>

I was going to make a full Tutorial with how to use this, plus how to use it on a per sub basis, meaning if you want to require admin for a specific part of the code, but there is no need.

Hope this helps

i dont think it works.
I used the first method and i built the project.
I ran the program. Still no admin required.
Works for me as well.
Lol. Maybe its just him..
its because your on XP, you do not need to change anything...
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us