Skip to content

Instantly share code, notes, and snippets.

@sys9kdr
Created November 18, 2017 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sys9kdr/f0c440ac6fc5d2fff4cd4a7f00110740 to your computer and use it in GitHub Desktop.
Save sys9kdr/f0c440ac6fc5d2fff4cd4a7f00110740 to your computer and use it in GitHub Desktop.
cmderのコマンドをラップしてチルダをいい感じにするやつ。
@echo off
rem usage
rem doskey=tildewrap command $*
echo %* | find "~" >NUL
if not ERRORLEVEL 1 goto TILDE
:CHAR
call %*
goto EOF
:TILDE
set tildedest=%*
call %%tildedest: ~= %USERPROFILE%%%
goto EOF
:EOF
@sys9kdr
Copy link
Author

sys9kdr commented Jan 7, 2018

案B? gotoを終了時に使わないやつ

echo %* | find "~" >NUL
if not ERRORLEVEL 1 goto TILDE

:CHAR
call %*
exit /b

:TILDE
set tildedest=%*
call %1 %USERPROFILE%\%%tildedest:%1 ~=%%
exit /b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment