Jump to content

Recommended Posts

Posted (edited)

I would like to get parent folder path base on @ScriptDir. Please kind to help how to do it.

Eg, @ScriptDir returns "C:\AutoIt\Script

I would like to get "C:\AutoIt" in this case.

Edited by DTNGUYEN
Posted

Thanks for help. However, i just find out another way to get by using _PathFull

#incllude<file.au3>

@LIB_DIR = _PathFull(@ScriptDir & "..\..\") & "LIB\"

Posted

StringRegExpReplace(@ScriptDir, '\\[^\\]*$', '')

Slightly off topic...I like this solution, but how would I modify it to only show the parent folder name and trim the left side of the path off. For example:

Have this:

$sPath = "C:\test1\test2\test3\test4\test.xml"

Need this:

$sParent = "test4"

Basically just the parent folder name and not the full path to the parent folder.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...