Is there a way to move down one directory using ms-dos? i.e scripts and batch files. Like i know you can move up one directory using ..\ but i need to move down one directory without knowing the name of the directory. Is there a command for that?
so if i was in c:\new i want a command that will get me to c:\new\test\testing
without using the name test
Thanks
When you move up a directory, there can only be one parent. So it makes sense to have a convenient method to do this - CD ..
But when you move down there can be any number of children to move to. How can you possibly know which one to move to if you don't know the name?
It is easy to iterate the children directories, at which point you could CD for example. You can use GOTO to break out of the loop so that you arbitrarily go to the first folder found.
for /d %%F in (*) do (
cd "%%F"
goto :break
)
:break