asmatullah
10 years agoContributor
Solved
How to go one level up in folder path .
Hi ,
I am using ProjectSuite.Path to get the path and want to move one level back .
How can I achieve this .
I am using ProjectSuite.Path to get the path and want to move one level back .
How can I achieve this .
- Hi,
I would do it this way (untested VBScript):
strPath = ProjectSuite.Path
strPath = aqFileSystem.ExcludeTrailingBackSlash(strPath)
strPath = aqFileSystem.GetFileFolder(strPath)
The last line will return the parent path because after the trailing backslash was removed from the path, aqFileSystem.GetFileFolder() treats everything after the last backslash as a file name and trims it (and in your case this will be the name of the current folder).
If you need to navigate two levels up, just duplicate two last lines:
strPath = ProjectSuite.Path
strPath = aqFileSystem.ExcludeTrailingBackSlash(strPath)
strPath = aqFileSystem.GetFileFolder(strPath)
strPath = aqFileSystem.ExcludeTrailingBackSlash(strPath)
strPath = aqFileSystem.GetFileFolder(strPath)