Created
June 8, 2013 12:51
-
-
Save mitaken/5735086 to your computer and use it in GitHub Desktop.
D&Dしたファイルを管理者権限で開きます
hostsファイルを編集するときなどに便利です。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| '起動するアプリケーション | |
| Const CstStrLaunchApplication = "notepad.exe" | |
| 'Const CstStrLaunchApplication = "C:\Program Files\Hidemaru\Hidemaru.exe" | |
| If WScript.Arguments.Count = 0 Then | |
| WScript.Quit | |
| End If | |
| Dim ObjShell | |
| Set ObjShell = WScript.CreateObject("Shell.Application") | |
| Call ObjShell.ShellExecute(CstStrLaunchApplication, """" & WScript.Arguments(0) & """", "", "runas") | |
| Set ObjShell = Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment