I am new to Batch script, just started understanding. I couldn't find right syntax for navigate up one directory.
current path=C:\Users\myname\gr\firstClone\gr\src\gui\prod
I want to move up to 'C:\Users\myname\gr\firstClone\gr\src\gui' so I can go to build folder where my build file resides
I have this in my batch file
for %%i in (.) do set CURRENT_PATH=%%~fi
set PROJECT_REL=%CURRENT_PATH%
set PROJECT_ROOT=%CURRENT_PATH%\..
set JAVA_HOME=%GCTI_JDK_1_8_0%
if ("%JAVA_HOME%")==() goto invalid_java_home
With below script i try to navigate up one folder
expected: C:\Users\myname\gr\firstClone\gr\src\gui\build\build_brgui.xml
Actual: "C:\Users\myname\gr\firstClone\gr\src\gui\prod\..\build\build_brgui.xml" The system cannot find the path specified.
but I get above error as navigation one level up is not happening.
set BUILDFILE="%PROJECT_REL%\..\build\build_brgui.xml"
My OS: Windows 10
Appreciate your help on this.