Skip to content

Instantly share code, notes, and snippets.

@rvegajr
Created September 29, 2021 15:41
Show Gist options
  • Save rvegajr/424285933c1677899ce05948dedb8ee6 to your computer and use it in GitHub Desktop.
Save rvegajr/424285933c1677899ce05948dedb8ee6 to your computer and use it in GitHub Desktop.
Get the parent path and child path
@echo off
:: --HAS ENDING BACKSLASH
set batdir=%~dp0..
:: --MISSING ENDING BACKSLASH
:: set batdir=%CD%
pushd "%batdir%"
set rootPath=%cd%
rem @echo off
set srcdir=%rootPath%/Src
:: --MISSING ENDING BACKSLASH
:: set batdir=%CD%
pushd "%srcdir%"
set srcPath=%cd%
@echo rootPath=%rootPath%
@echo srcPath-%srcPath%
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment