Skip to content

Instantly share code, notes, and snippets.

@moluapple
Last active December 17, 2015 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moluapple/5690732 to your computer and use it in GitHub Desktop.
Save moluapple/5690732 to your computer and use it in GitHub Desktop.
Powershell 命令收集
Dir *.png | rename-item -newname { $_.name -replace ".png",".pdg" }
Dir *.pdg | rename-item -newname { "000" + $_.name }
//Batch Incremented File Rename
$files = Get-ChildItem c:\yourpath\*.ext
$id = 1
$files | foreach {
Rename-Item -Path $_.fullname -NewName (($id++).tostring() + $_.extension)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment