Skip to content

Instantly share code, notes, and snippets.

@phidn
Forked from vitalybe/fav.bat
Created April 17, 2022 00:18
Show Gist options
  • Save phidn/f5d8a148c7d8cbb479b350d94eae64ec to your computer and use it in GitHub Desktop.
Save phidn/f5d8a148c7d8cbb479b350d94eae64ec to your computer and use it in GitHub Desktop.

Revisions

  1. @vitalybe vitalybe revised this gist Sep 7, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fav.bat
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    setlocal
    @setlocal
    @echo off
    set userChoice=%1
    rem The format is:
  2. @vitalybe vitalybe revised this gist Sep 7, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions fav.bat
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    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\
  3. @vitalybe vitalybe created this gist Sep 7, 2015.
    15 changes: 15 additions & 0 deletions fav.bat
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    setlocal
    @echo off
    set userChoice=%1
    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