Last active
November 15, 2016 09:22
-
-
Save rochefort/710693 to your computer and use it in GitHub Desktop.
_open.vbs
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
Option Explicit | |
Dim WShell, oExec | |
Set WShell = WScript.CreateObject("WScript.Shell") | |
Dim openPath, numArgs, argPath | |
Dim exe | |
exe = "explorer /root," | |
'exe = "C:\opt\apl\mdie0300RC6\MDIE.exe" | |
'exe = "C:\opt\apl\xf11-7\XF.exe" | |
numArgs = WScript.Arguments.Count | |
'[.][./]は引数無しと一緒(カレントパス) | |
If numArgs > 0 Then | |
argPath = Replace(WScript.Arguments.Unnamed.Item(0), "/", "\") | |
If argPath = "." or argPath = ".\" then | |
openPath = WShell.CurrentDirectory | |
Else | |
openPath = argPath | |
End If | |
Else | |
openPath = WShell.CurrentDirectory | |
End If | |
Set oExec = WShell.Exec(exe &" " &"""" & openPath & """") | |
Set WShell = nothing | |
Set oExec = nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@echo off
CScript C:\opt\bin_open.vbs //nologo