Skip to content

Get Previous Directory

Daniel Wanner

Asked Jun 21, 2013, 1:36 AM EDTSolved
Share
LinkedInX
Dear Dudes,

Heres my problem. i got a directory "...//1", and in that dir, there is a Launcher "launcher.exe". now, in "...//1" there is a directory in which the actual game
is in.Now, how do i get data from the previous "...//1" Directory? Help willl be much appreciated :)
(Sry if my English is bad, its not my first language.)

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Sunny  Sharma
    ✓ Accepted answer0
    Hi Daniel,

    thanks for the good question. if I'm getting you right, you want to navigate to the Parent Directory of a location.

    If yes, then you can use do so:
    ------------------------------
    Code
    Directory.GetParent("D:\\test\\myDir").Parent;
    
    ------------------------------
    
    This will give you the parent directory "D:\\test"
    
    Hope it helps.
    
    Happy Coding :)
    0