這篇文章主要介紹了vbs中獲取當(dāng)前腳本所在路徑的2個(gè)方法,本文中的方法都是通過FileSystemObject來實(shí)現(xiàn),需要的朋友可以參考下
方法一:
復(fù)制代碼代碼如下:
currentpath = createobject("Scripting.FileSystemObject").GetFolder(".").Path
方法二: 復(fù)制代碼代碼如下:
currentpath = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path