summaryrefslogtreecommitdiff
path: root/xmake/scripts/sudo.vbs
blob: 9bc71637c4ec6232e37f56079285a391dfe279e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Set UAC = CreateObject("Shell.Application")
Set Shell = CreateObject("WScript.Shell")
If WScript.Arguments.count < 1 Then
    WScript.echo "Help: sudo <command> [args]"
ElseIf WScript.Arguments.count = 1 Then
    UAC.ShellExecute WScript.arguments(0), "", "", "runas", 1
Else
    Dim ucCount
    Dim args
    args = NULL
    For ucCount = 1 To (WScript.Arguments.count - 1) Step 1
        args = args & " " & WScript.Arguments(ucCount)
    Next
    UAC.ShellExecute WScript.arguments(0), args, "", "runas", 5
End If