cmd.exe.のオプション





起動ディレクトリを制御する


DESC cmd.exe の Shortcut 作成 Shortcut Tab で Directory 指定


補完をONにする


DESC c-f で file 名を補間 %SystemRoot%\system32\cmd.exe /f:on W-r は PATH にある file をさがすので 次のような bat をおいておく
:: bash.bat :: bash を高速に起動 cmd /K "D: && cd cygwin/bin && bash --login"



コマンドの出力結果を変更


:: UNICODE cmd /u :: ANSI cmd /a



Interpreter.のしくみ


:: quot は ["] のみ ['] はだめ :: OK > "hostname" :: BAD > 'hostname'
bash と連携する。 POINT cmd prompt は ["] を特別な文字として扱わずに CommandLine の文字列を bash にそのまま渡す。 bash は -c "/script/test.sh d:\foo\test.txt" として引数をうけとる。 結果 -c "/script/test.sh d:footest.txt" となってしまう そこで -c "/script/test.sh \"d:\foo\test.txt\"" を bash ( interpreter ) に渡す。 次のように解釈される -c /script/test.sh "d:\foo\test.txt"
bash -c "/script/test.sh d:\foo\test.txt" bash -c "/script/test.sh \"d:\foo\test.txt\""