5/1/2023 0 Comments Mass rename files pattern![]() ![]() Remember when I said that I had ripped multiple training DVDs, and the contents of each one were stored in its own folder? Well, some of the training classes span multiple DVDs. But here is where the starting number comes into play. If it finds files with the specified extension, it renames them using the base file name you provided. With this information, the script checks the specified path for the existence of any file with the extension provided. The script starts out by prompting you to enter four pieces of information: the path where the files reside, the new base file name you want to use, the file extensions and a starting number (which I will explain in a second). Write-Host "The files have been renamed:" ![]() Rename-Item -Path $_.FullName -NewName $NewName Write-Host "Old Name: " $_.FullName " New Name: " $NewName $NewName = $Filename + " " + $StartingPoint + "." + $Extension Get-ChildItem -Path $Path -Filter *.$Extension | $StartingPoint = Read-Host "Please enter a starting number" $Extension = Read-Host "Please enter the file extension" $Filename = Read-Host "Please enter new file name" Here is what the script looks like: $Path = Read-Host "Please enter the file path" With a little bit of creativity, I was able to use PowerShell to greatly simplify the task.īut why stop there? Rather than just creating a throwaway script that would work for this one project and nothing else, I created a script that should work for nearly any bulk renaming task. Obviously, I wanted to give these files more descriptive names, but I really didn't want to manually rename hundreds of files by hand. Figure 1: This is what the file structure looked like when I got done ripping the DVDs. You can see an example of this in Figure 1. MP4 files within that folder have names like Title_1, Title_2 and so on. In my case, for example, the tool I used to rip the DVDs placed each disc's contents into a separate folder. The real trick is dealing with the aftermath once the ripping process is complete. The process of ripping a DVD is simple there are a countless utilities available that will allow you to do it. MPG so I could watch them on my computer anytime I wanted (I have the publisher's permission and am not violating any copyright laws). As such, I wanted to convert the videos to. At least some of the information on those DVDs is still relevant, but DVD drives are in short supply these days. A few years back, someone gave me a collection of IT training videos on DVD. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |