以前我寫過
Option Explicit
Dim f1,fbn
'f1 = App.EXEName
'f1為BaseName
f1="莊敬自強"
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
'Set f = fso.GetFile(f1 & ".exe")
Set f = fso.GetFile(f1 & ".vbs")
dim n
n = fso.GetParentFolderName(f.path)
Dim objXLApp
set objXLApp = WScript.CreateObject("Excel.Application")
objXLApp.Visible = True
objXLApp.Workbooks.Open (n & "\" & f1 & "資料庫\" & f1 & ".xls")
Set objXLApp = Nothing
Set fso = Nothing
Set n = Nothing
Set f = Nothing
WScript.Quit