
No License
VBA
2021年03月25日
Option Explicit
main
sub main()
Dim path
Dim fileName
On Error Resume Next
'ドラッグ&ドロップされたファイルのパス
path = WScript.Arguments(0)
'ダブルクリックでオープンされた場合、自身のフルパスを返す
If Err Then path = WScript.ScriptFullName
On Error Goto 0
'ファイル名とフルパスを表示
fileName = Mid(path, InStrRev(path, "\") + 1, Len(path) - InStrRev(path, "\"))
InputBox fileName & "のフルパス", "フルパス取得", path
end sub
No one still commented. Please first comment.