Monitor and Change File Extension for all files in folder

Monitor and Change File Extension for all files in folder.

1
2
3
4
5
6
7
8
9
10
11
12
13
$stop = $false
$i = 0
do{
    $files = Get-ChildItem -LiteralPath "C:\Users\Public\Documents" -Filter *.txt
    ForEach ($file in $files){
        $newfile = $file.FullName.Replace('.txt','.nfo')
        Rename-Item -LiteralPath $file.FullName -NewName $newfile
        $i += 1
        sleep -Milliseconds 250
    }
Write-Host renamed $i files. sleeping...
sleep -Seconds 1
}While($stop -eq $false)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.