Abyssmedia.com Forum Index Abyssmedia.com
Abyssmedia Support Forums
 
  FAQ    Search    Memberlist    Usergroups   Register 
  Profile    Log in to check your private messages    Log in 

UAC Elevation

 
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> ScriptCryptor
View previous topic :: View next topic  
Author Message
MethosFrost



Joined: 10 Sep 2011
Posts: 2

PostPosted: Mon Sep 12, 2011 1:48 pm    Post subject: UAC Elevation Reply with quote

What is the best way to force UAC Elevation? I can do it using the code below in VBScript but once I convert to exe it won't work.
Code:

If WScript.Arguments.length =0 Then
  Set objShell = CreateObject("Shell.Application")
  objShell.ShellExecute "wscript.exe", Chr(34) & _
  WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
Else
  'Code here
End If


I can alternately right-click and set the exe to "run as administrator" in the compatibility properties. But when I pass the exe file on to another PC the run as administrator is gone.

Any other way I try to elevate UAC I somehow get into an endless loop.
Back to top
support
Site Admin


Joined: 13 Feb 2004
Posts: 378

PostPosted: Mon Sep 12, 2011 6:40 pm    Post subject: Reply with quote

You need to add administrator manifest to exe file or place it it the same folder. Fox example:

example.exe
example.manifest

Manifest file should contains these strings:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> ScriptCryptor All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2011 phpBB Group