Page 1 of 1

[Solved] Ascend one directory in a hierarchy?

Posted: 07 Feb 2011 15:46
by highend
Mh,

when I'm in a specific folder in a directory hierarchy, how do I get one hierarchy higher?

I can't use a full path (dir names will be random and I'm already in such a dir when the script is invoked) but
the ascending has to be done relative to the current dir.

e.g. I'm in: D:\Temp\foobar and I want the script to change the dir to D:\Temp

Code: Select all

goto "..\";
is bringing me back to the last directory before I switched (manually) to D:\Temp\foobar
(in this case D:\Users\Admin\Downloads)

Tia,
Highend

Re: Ascend one directory in a hierarchy?

Posted: 07 Feb 2011 15:58
by zer0
You can use #523, which is a command for "Up" ;)

Re: Ascend one directory in a hierarchy?

Posted: 07 Feb 2011 16:04
by Stefan
highend wrote:when I'm in a specific folder in a directory hierarchy, how do I get one hierarchy higher?
[...]
e.g. I'm in: D:\Temp\foobar and I want the script to change the dir to D:\Temp

Code: Select all

goto "..\";
or
goto "<curpath>\..";

Re: Ascend one directory in a hierarchy?

Posted: 07 Feb 2011 16:33
by highend
Ok, script is working now.

Thank you zer0 & Stefan!