1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

学生(生徒)フォルダをまとめて作成する

Last updated at Posted at 2024-06-07

コマンドプロンプトを使用する

例えば、現在のディレクトリにフォルダを作成したいとき、コマンドプロンプトに次のように打ち込んでEnterを押下すればフォルダが作成できます。

C:\Users\user> mkdir student01

つまり、この部分を自動化すれば1度に大量のフォルダを作成することができます。
具体的には.bat形式のバッチファイルを作成(テキストエディタで作れる)します。

下準備 エクセルでテキストを作成する

エクセルでこんな感じの表をオートフィルをうまく使って作成し、&などでABC列を結合します。
mkdirの後には半角のスペースを忘れずに。
その後、E2:D11部分をコピーし、メモ帳などに貼り付けします。

image.png

まとめ

あとは.bat形式で保存し、フォルダを作成したいディレクトリ上でバッチファイルを開けばフォルダを作成する処理が実行されます。

デスクトップ上で実行するとデスクトップにディレクトリが作成されます。
実行する場所に注意してください。

これでstudent01-student11のようなフォルダをまとめて作成することができます。
cd等を使って処理中にディレクトリを移動すれば、さらに深い階層のディレクトリもまとめて作成できますね。

sample.bat
mkdir student01
mkdir student02
mkdir student03
mkdir student04
mkdir student05
mkdir student06
mkdir student07
mkdir student08
mkdir student09
mkdir student10
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?