0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows11 Powershellでファイル名の一括変更

Posted at

概要

Windows11でファイル名の一括変更を行う手順です。
image.png

手順

  1. ファイルが格納されているフォルダを開き、Shiftを押しながら右クリックし「ターミナルで開く」を選択。
    image.png

  2. 起動したPowershellで以下のコマンドを実行

Get-ChildItem | Rename-Item -NewName { $_.Name -replace 'before(.*)','after$1'}

image.png
image.png

その他

  • 拡張子を変更する場合
Get-ChildItem | Rename-Item -NewName{$_.Name -Replace "\.txt",".log"}

["\.txt",".log"]を変更前、変更後で入力。

  • 連番を付与する場合
ls -File | sort Name | % {$i = 1} { $Newname = "title_" + $i.tostring("000")+$_.extension; rename-item $_ $Newname; $i++ }

[title_]にファイル名の先頭を入力。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?