Last active
January 3, 2016 10:47
-
-
Save nibral/8039527622c00c463c68 to your computer and use it in GitHub Desktop.
Launch Cmder in specified directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem 指定した作業ディレクトリでCmderを立ち上げるバッチ | |
rem 使い方: Cmder.bat <作業ディレクトリ> | |
rem 本来Cmderは/STARTオプションで起動するディレクトリが指定できるはずだが、 | |
rem 指定を無視してCmderを呼び出したプログラムの作業ディレクトリで起動してしまう。 | |
rem とりあえずの対策として、このバッチでコマンドプロンプトを噛ませることにした。 | |
rem HKEY_CLASSES_ROOT\Directory\shell\Cmder Here\commandに「launch_cmder.bat "%V"」で | |
rem 登録すると、フォルダの右クリックメニューに出てくれて便利。 | |
rem 引数が指定されていない場合はC:\Users\ユーザ名で起動 | |
if "%~1" EQU "" ( | |
set CMDERPATH="%USERPROFILE%" | |
) else ( | |
set CMDERPATH=%1 | |
) | |
rem 指定された作業ディレクトリに移動 | |
cd %CMDERPATH% | |
rem Cmder起動 | |
C:\tools\cmder\Cmder.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment