Skip to content

Instantly share code, notes, and snippets.

@rochefort
Last active November 15, 2016 09:22
Show Gist options
  • Save rochefort/710693 to your computer and use it in GitHub Desktop.
Save rochefort/710693 to your computer and use it in GitHub Desktop.
_open.vbs
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
@rochefort
Copy link
Author

@echo off
CScript C:\opt\bin_open.vbs //nologo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment