tags:

views:

113

answers:

1

I am working through the AHK docs but am having a hard time finding a fairly simple way to find the path to a target file in a parent directory, given a starting directory.

For example:

Starting in C:\a\b\c\d\e\f\g\

I want to find the path of root.txt where:

C:\a\b\c\root.txt

I want to return C:\a\b\c\

[by the way I do not know where root.txt lives]

+1  A: 

i would make a loop and add "..\" to the current directory path each time
it works in autohotkey, i always use it

for example, i have my scripts in one directory,
and images in another on the same level so my images paths are always

%A_ScriptDir%\..\images\
stansult