Skip to content

Instantly share code, notes, and snippets.

@jueti
Last active December 3, 2018 08:32
Show Gist options
  • Save jueti/34a6a650a6ac9f634c49a13529d4d9f9 to your computer and use it in GitHub Desktop.
Save jueti/34a6a650a6ac9f634c49a13529d4d9f9 to your computer and use it in GitHub Desktop.
[bat get parent folder name] #bat #cmd
@echo off
set "cd_=%cd%"
:loop
set "cd_=%cd_:*\=%"
set "cd_tmp=%cd_:\=%"
if not "%cd_tmp%"=="%cd_%" goto loop
echo "cd_"
echo;
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment