I am trying to create a vbscript macro which would get the folder location in which the macro is stored and create the output files into the same folder. I am using the below code but its not getting the correct location
Set obj1FSO = CreateObject("Scripting.FileSystemObject")
folderLoc = obj1FSO.GetParentFolderName("\Cubes_Macro_V5.zmc")
It would then use the folderLoc variable and append the output file name to it in order to create the output file in the same folder as where the macro is stored.
Set repFso = CreateObject("Scripting.FileSystemObject")
Set repFile = repFso.CreateTextFile(folderLoc & "RCHT_OPTION4_REPORT.txt", True)
The Macro is stored in a folder in the D:\ drive but when I run the above segment of code it get the location for the desktop.