Skip to content

Instantly share code, notes, and snippets.

@vitalybe
Last active April 17, 2022 00:18
Show Gist options
  • Save vitalybe/e5e903054c5162fae4d3 to your computer and use it in GitHub Desktop.
Save vitalybe/e5e903054c5162fae4d3 to your computer and use it in GitHub Desktop.
Favorite folders batch (For Windows)
@setlocal
@echo off
set userChoice=%1
rem The format is:
rem call :condition SHORTCUT FOLDER
call :condition web c:\Git\SecThor\SecWeb\App\
call :condition cloud c:\Git\SecThor\SecCloud\dojo.backend\
call :condition good c:\Users\Vitaly\Dropbox\Projects\goodread-friends\
endlocal
popd
GOTO :eof
:condition
rem We do PUSHD twice since endlocal does popd once :|
if "%userChoice%"=="%1" pushd %2 & pushd %2 & echo pushd %2
if "%userChoice%"=="" echo %1 =^> %2
GOTO :eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment