locked
Get path to root directory in batch script RRS feed

  • Question

  • Hi ,

    In my batch script i set the current directory path like

    set CURR_FOLDER=%CD%

    This folder is 2 levels deep to root folder. I want to set another variable which will be path to the root.

    Set PROJROOTFOLDER=<path to root>

    How to get the path to root folder?

     

    Thanks in advance.

    Thursday, August 4, 2011 3:34 AM

Answers

  • Never mind found the answer myself

    pushd ../..
    
    Set PROJROOTFOLDER=%CD%
    
    popd


    • Marked as answer by zoollu Thursday, August 4, 2011 4:00 PM
    Thursday, August 4, 2011 4:00 PM