0
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?

Windows コマンドプロンプトでの複数ファイルのフォーマット変換をone-linerで処理 【自分用メモ】

Last updated at Posted at 2023-03-06

いつかの次回に絶対忘れてると思うので自分用メモ。
大量のwebpファイルをjpegにしたかっただけ。(理由は謎。)

>for %f in (*.webp) do ffmpeg.exe -loglevel error -i %f %f.jpg

ちゃんとやるならImageMagickとかインストールしてconvertしますが一時(いっとき)の用途には既に入れてたffmpeg.exeで十分。ちなみに自分はPowerShellも入れてない。
for文についてネットにun*x系は書いてあるのを見かけますがWindowsでは( )が必須だったりして微妙に仕様が違うし、「バッチファイルで」って書いてあったりしますが、んなもんは不要で直接one-linerでいけます。コマンドラインでfor文なんて初めて使ったのでその記念に。
出来上がったファイル群はファイル名がアレですが、Flexible Renamerとかで一括変更。
こういうのはお手軽さが肝心。

0
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
0
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?