Skip to content

Instantly share code, notes, and snippets.

@hkuno9000
Created November 13, 2015 01:38
Show Gist options
  • Save hkuno9000/858a5670dd9039d29b8a to your computer and use it in GitHub Desktop.
Save hkuno9000/858a5670dd9039d29b8a to your computer and use it in GitHub Desktop.
fuzzy chdir on Windows batch file: change folder on a current folder or parent folder.
@echo off
for /D %%f in ("%1*" "..\%1*" "..\..\%1*") do if exist "%%f" chdir "%%f" & goto :EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment