1

I want to properly rename all my downloaded music files. Most of them start with "download -" and after that comes the music file name. Is there a possibility to remove the "download -" from all the files without renaming them 1 by 1?

Thanks in advance

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Feb 1, 2022 at 9:19

2 Answers 2

0

The following .bat file will do it:

@echo off
setlocal enabledelayedexpansion 
for %%f in ("download - *.*") do (
  set var=%%f
  ren "!var!" "!var:download - =!"
)

For more information see How-to: Edit/Replace text within a Variable.

0

Seems simple if you know how. It's not exactly the same but very similar. You can use a Powershell Script to get ride of the "download-" part.

# Root path
$RootPath = "C:\Temp\"
# Rename folders 
Get-ChildItem -Path $RootPath -Filter 'download -*' | Rename-Item -NewName { $_.Name -replace 'download -*', '' }

How it works is $RootPath defines your File location. In your case it would be something like: "C:\Users\Username\Downloads"

Next Get-ChildItem looks for a file with "download -" at the beginning of the filename and replaces it with nothing. In other words it removes that part.

Here is the previous post I based the script on. Previous Post

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .