-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b5299a
commit 9d6b837
Showing
4 changed files
with
145 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
' Subscript of Cmd Dict by wanderSick | ||
' See main script -- fy.cmd -- for more details. | ||
|
||
' Used to run desired programs as administrator (for Vista or later with UAC) | ||
' Based on http://www.winhelponline.com/articles/185/1/VBScripts-and-UAC-elevation.html | ||
|
||
Dim objShell, FSO | ||
Dim strFolder, strFile | ||
On Error Resume Next | ||
Set objShell = CreateObject("Shell.Application") | ||
Set FSO = CreateObject("Scripting.FileSystemObject") | ||
strWorkDir = WScript.Arguments(0) | ||
strFile = WScript.Arguments(1) | ||
strArg = "/c start " & chr(34) & chr(34) & " /d " & chr(34) & strWorkDir & chr(34) & " " & chr(34) & strFile & chr(34) | ||
'Debug line | ||
'Msgbox strWorkDir & strFile & vbcrlf & strArg | ||
If FSO.FileExists(strFolder & strFile) Then | ||
objShell.ShellExecute "cmd.exe", strArg, "", "runas", 1 | ||
Else | ||
MsgBox "File " & strFile & " not found." | ||
End If |
This file contains 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
This file contains 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