Skip to content

Instantly share code, notes, and snippets.

@adojos
Last active March 9, 2023 11:03
Show Gist options
  • Save adojos/a7cb25ed7a56d6ac8eae49f0d01c26ab to your computer and use it in GitHub Desktop.
Save adojos/a7cb25ed7a56d6ac8eae49f0d01c26ab to your computer and use it in GitHub Desktop.
VBS: Auto-launch script with Elevated Privileges on Win #vbs
If WScript.Arguments.length = 0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "cscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 3
WScript.Quit
End If
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment