Skip to content

Instantly share code, notes, and snippets.

@ebibibi
Created June 16, 2014 03:36
Show Gist options
  • Select an option

  • Save ebibibi/a198ff20bc42a03e789a to your computer and use it in GitHub Desktop.

Select an option

Save ebibibi/a198ff20bc42a03e789a to your computer and use it in GitHub Desktop.
run as administrator in vbscript
do while WScript.Arguments.Count=0 and WScript.Version>=5.7
'Run this script as admin.
Set sha=CreateObject("Shell.Application")
sha.ShellExecute "wscript.exe",""""+WScript.ScriptFullName+""" uac","","runas"
WScript.Quit
loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment