Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2003
    Posts
    8

    Security Priv of Shortcut

    How can I make the shortcut that is created by SF set to always run the EXE as an Administrator even if the user is not an Admin. IOW, the EXE needs Admin priv and as long as the user doing the install has admin priv. I would like the shortcut created by SF to be modified to run exe with admin priv....

    Thanks

    Alec

  2. #2
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Your best bet is to use a manifest.
    unfortunately, the Shell.CreateShortcut() does not include any "runas" parameters.

    You could trying using the shell command "runas.exe" to launch your exe.
    or you could do something with AutoIt and automate the shortcut creation tailoring it exactly as you desire.

    Here's some notes I had saved from a similar issue a while back:

    If you play around with the run as administrator setting for both the current user and all users on an exe's properties you will see the following keys being set:

    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

    Note that not all shortcuts point directly at an exe, depending upon whether an application is installed as an advertised application.

    Setting a shortcut to run an app as admin, when possible (i.e. the shortcut actually points at an exe) is the same as going into the apps exe properties box and selecting run as admin, thus if it is cmd.exe then you would be setting cmd.exe to run as admin no matter how it were started, so you would need to possibly be resetting it back after it were started to avoid making it run as admin thereafter.

    http://msdn.microsoft.com/en-us/libr...94(VS.85).aspx
    Last edited by jassing; 10-12-2009 at 05:51 PM. Reason: added in some notes I had.


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

Posting Permissions

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