2

My script PowerShell:

$liste = get-content "Y:\Users\H\Documents\D\Game Of Throne\prod\recup.txt" `
         |Select-Object -last 1

$liste | ForEach-Object {Write-Host ($i++) $line}

get-childItem "Y:\Users\H\Documents\D\Game Of Throne\*.bmp*" `
       | rename-item -newname { $_.name -replace("aaa",$line)}

Example of files to rename: GameOfThrone aaa.bmp; GameOfThrone aaa(2).bmp ...

In text file:

A
B
C

I want my files named as follows: GameOfThrone A.bmp; GameOfThrone B.bmp ...

RedGrittyBrick
  • 81,981
  • 20
  • 135
  • 205
Hamdoun
  • 21
  • 1
  • It's not clear what you're trying to achieve. Please rephrase your question and list the file contents. – megamorf Jun 15 '15 at 08:21
  • possible duplicate of [Automate script | Rename a defined list of filename by a defined list of word powershell](http://superuser.com/questions/927127/automate-script-rename-a-defined-list-of-filename-by-a-defined-list-of-word-po) – megamorf Jun 15 '15 at 08:32

0 Answers0