summaryrefslogtreecommitdiff
path: root/xmake/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2018-11-11 15:29:06 +0800
committerruki <[email protected]>2018-11-11 15:29:06 +0800
commitf372a5c5cf20e9a7deaa99cdb9d2c14b5aec7755 (patch)
treede254801dde03db15fffb313004ee316ac121ed4 /xmake/scripts
parent7d5215f5807e37a23d350aaa11fc1e1b6464bd7e (diff)
improve to update with sudo on win7
Diffstat (limited to 'xmake/scripts')
-rw-r--r--xmake/scripts/sudo.vbs15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/scripts/sudo.vbs b/xmake/scripts/sudo.vbs
new file mode 100644
index 000000000..9bc71637c
--- /dev/null
+++ b/xmake/scripts/sudo.vbs
@@ -0,0 +1,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