set privilege level to shortcut using VBS

Home Forums Scripting Windows Script Host set privilege level to shortcut using VBS

This topic contains 1 reply, has 1 voice, and was last updated by Avatar XtaZee 9 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Avatar
    XtaZee
    Member
    #148976

    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!

    Avatar
    XtaZee
    Member
    #224356

    Re: set privilege level to shortcut using VBS

    well… found one way to do it:

    Code:
    reg add “HKCUSoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers” /v “” /t REG_SZ /d RUNASADMIN
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.