Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [[-]] VBS/Batch - Run Script As Admin [[-]]
- VBS File:
- Set objShell = CreateObject("Shell.Application")
- Set objShellShell = CreateObject("WScript.Shell")
- strScriptPath = objShellShell.CurrentDirectory & "\replace with your file name.bat"
- objShell.ShellExecute "cmd.exe", "/c """ & strScriptPath & """", "", "runas", 1
- Save this as RunAsAdmin.vbs. Then, create a batch script to run this.
- For example:
- @echo off
- RunAsAdmin.vbs >nul
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement