這個很簡單,給妳壹個最簡單的實現吧。
把下面代碼保存成vbs文件,然後放入妳這個含有Data目錄的文件夾,直接雙擊就行了。
把代碼中的Data改成其他的,就是運行其他文件夾下的文件。
Dim?path
Dim?folder
folder?=?"data"
path=""
Set?ws?=?CreateObject("WScript.Shell")
path?=?Left(wscript.scriptfullname,InStrRev(wscript.scriptfullname,"\"))?
path?=?path?&?folder
test()
sub?event_onquit
WScript.quit?
quit
end?sub?
Function?test()
Set?fso?=?CreateObject("Scripting.FileSystemObject")
Set?folder?=?fso.GetFolder(path)
getFilesInFolder(folder)
End?Function?
Function?getFilesInFolder(folder)?
Dim?files
Dim?s
Dim?fileName
Set?files?=?folder.Files
For?Each?file?in?files
fileName=file.Name
ws.run?path?&?"\"?&?fileName
Next
End?Function