Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM Three files follow
- REM RunAsAdminConsole.bat
- REM This file compiles RunAsAdmin.vb to RunAsAdmin.exe using the system VB.NET compiler.
- REM Runs a program elevated using a manifest
- C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc "%~dp0\RunAsAdmin.vb" /win32manifest:"%~dp0\RunAsAdmin.manifest" /out:"%~dp0\RunAsAdmin.exe" /target:winexe
- REM To use
- REM RunAsAdmin <Command to run>
- pause
- --------------------------------------------------------------------
- RunAsAdmin.Manifest
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <assemblyIdentity
- version="1.0.0.0"
- processorArchitecture="*"
- name="Color Management"
- type="win32"
- />
- <description>Serenity's Editor</description>
- <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
- <security>
- <requestedPrivileges>
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
- </requestedPrivileges>
- </security>
- </trustInfo>
- </assembly>
- --------------------------------------------------------------------
- 'RunAsAdmin.vb
- imports System.Runtime.InteropServices
- Public Module MyApplication
- Public Sub Main ()
- Dim wshshell as object
- WshShell = CreateObject("WScript.Shell")
- WshShell.Run(Command())
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement