DOSバッチ記事の目次はここです。 最近ちょっと WINDOWS VISTA上で、DOSバッチファイルを作り実行させている。 それにしてもバッチファイルの文法(表現)は奇妙ですね。 変数に%を2つ付けるとか、変数名は1文字だけとか、変なオプションがあるとか・・・。 こんな変なスクリプト言語は深入りしない方が無難・・・。 ■ファイル名一覧を表示 以下テーブル左側のコードを TEST.bat という名前のファイルに記入し、テキストファイルが複数あるフォルダで実行すると、テーブル右側の結果が得られます。 @echo off echo -----------------------フルパス for %%A in (*.txt) do echo %%~fA echo -----------------------ドライブ名 for %%A in (*.txt) do echo %%~dA echo