Announcement

Collapse
No announcement yet.

set privilege level to shortcut using VBS

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • set privilege level to shortcut using VBS

    Hi,
    I have a similar code to this one, it will create a shortcut, what I need is to enable the "run this program as an administrator ":

    Code:
    set WshShell = WScript.CreateObject("WScript.Shell" )
    strDesktop = WshShell.SpecialFolders("AllUsersDesktop" )
    set oShellLink = WshShell.CreateShortcut(strDesktop & "\Windows Explorer.lnk" )
    oShellLink.TargetPath = "%SYSTEMROOT%\explorer.exe"
    oShellLink.WindowStyle = 1
    oShellLink.IconLocation = "%SystemRoot%\explorer.exe"
    oShellLink.Description = "Windows Explorer"
    oShellLink.WorkingDirectory = "%HOMEPATH%"
    oShellLink.Save
    thanks!

  • #2
    Re: set privilege level to shortcut using VBS

    well... found one way to do it:

    Code:
    reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "<Location_of_target_file>" /t REG_SZ /d RUNASADMIN

    Comment

    Working...
    X