vbs中獲取腳本當前路徑的2個方法

字號:


    方法一:
    代碼如下:
    currentpath = createobject("Scripting.FileSystemObject").GetFolder(".").Path
    方法二:
    代碼如下:
    currentpath = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path