This is a method to retrieve the folder containing VBS files using VBS. This allows you to perform operations using the absolute path to the folder containing VBS files.
Code
1 2 3 4 5 6 7 |
' File System Object Dim objFileSystemObject Set objFileSystemObject = WScript.CreateObject("Scripting.FileSystemObject") ' Folder path containing .vbs files Dim strFolderPath strFolderPath = objFileSystemObject.GetFolder(".").Path |
The variable strFolderPath will store the folder path.