Questions tagged [batch-rename]
This tag is about the renaming of large batches of files.
320
questions
0
votes
1
answer
72
views
Can I use a .bat file to rename all the FOLDERS in a directory?
Can anyone please help me figure out how to strip-off or remove part of all of the FOLDER names in a directory? I’m trying to remove this 7 character string “SSA RI ” (including the middle and ...
0
votes
0
answers
83
views
Flatten Folder Structure, Move Files from Sub-Folders to Main
In Windows command line, is there a way to bulk move all the contents of subfolders up some levels? In other words, a way to get rid of selected subfolders while keeping their contents? I would like ...
0
votes
2
answers
78
views
How to use Command-line to batch-rename the FOLDER prefix using wildcards
So it has been mentioned that REN can be used to rename a FOLDER, but wildcards are not allowed.
I have a directory with a couple of hundred FOLDERS, where I want to remove the first seven characters (...
1
vote
1
answer
80
views
find and rename base directory and files under each basedir, add a prefix
I would like to recursively rename all matching directories and files under a path with a prefix that depend from the current directory.
.
├── G1_BIN_REFINEMENT
│ └── marker_genes
│ └── ...
1
vote
2
answers
123
views
Batch remove irregular suffix from folder names
I have a series of folders named in the following fashion:
11.23 John Smith
12.912 Kate Spade
23.34 Alexander McQueen
22.E01 Michael Kors
I want to rename the folder names to just:
11.23
12.912
23.34
...
3
votes
1
answer
336
views
Windows Explorer doesn't show updated names when changing capitalization (multiple files via script)
If I have 5 or more files in a Windows Explorer folder and I rename them with a script that only changes capitalization, Explorer doesn't automatically "refresh" and show the new names in my ...
0
votes
2
answers
165
views
Code that batch renames all .png files with increasing numbers, but how to i add so that the same happens with .jpg files too?
Workflow:
use cd FilePath\Folder first
write ls to get the files read
code that works with .png files only:
Get-ChildItem *.png |
ForEach-Object -Begin { $count = 1 } -Process {
Rename-Item $_ ...
0
votes
3
answers
229
views
Renaming files with batch file by "substring" part of the file name
I have loads of files that I want to rename using a batch file, they are music files in this case and start with artist name, album then song number an finally the song name.
I want, if possible ...
0
votes
2
answers
261
views
Remove all characters in multiple filenames, that follow a specific character, in Mac OS
Trying to find a script, or app, that batch removes filename clutter following proper formatting.
For example this Exercise [2009] previous version.png into this Exercise [2009].png
I need the final ...
0
votes
2
answers
262
views
Is there a way to mass rearrange parts of a file name for many files in Windows Command Prompt?
I have a folder of files where the names of the files are dates. I need to change the names of the files from mm-dd-yyyy.eXtension to yyyy-mm-dd.eXtension.
This is what I currently have:
03-31-2019....
1
vote
1
answer
40
views
Recursive rename with negate filter not working
I want my script to recursively rename all .mov files to _Proxy.mov, BUT I also want it to SKIP any files already named _Proxy.mov. The below command is still renaming all .mov files, and is ignoring ...
0
votes
1
answer
493
views
Batch Rename - Parent folder + text + Incrementing Number per directory
I'm trying to build a batch file which will carry out a rename of all subdirectories in a location in the format of 'parent directory filename' followed by underscore followed by '4 digit incrementing ...
0
votes
1
answer
528
views
Rename all file in a Folder
I am trying to rename all the file in a folder using this:
@echo off
setlocal EnableDelayedExpansion
for "%file_path_history%" %%a in (*.*) do (
if not "%~nx0"=="%%a" ren ...
1
vote
3
answers
1k
views
How to trim multiple file names using batch file
I need to trim all file names in a folder on a daily basis and therefore am searching for batch file recommendations. Any help is much appreciated!!
The numbers behind the file names are changing on a ...
0
votes
1
answer
56
views
Power Tools Renaming "Author - Title" to "Title (Author)"
I want to use Power Toys' Power Rename utility to rename some PDFs that have their filenames in the form of "Author - Title" to "Title (Author)".
Can anyone help me with the ...
1
vote
1
answer
765
views
Rename files based on specific text in file, file contains lots of Spaces and other text
I have been trying to get this to work without success. I have searched here and elsewhere for help and tried everything I could think of, the issue is its selecting additional text, I then get ...
0
votes
1
answer
238
views
How to add prefix to folder name using wildcard without using Powershell
i wanna create a batch script to rename C:\Program Files\WindowsApps\Microsoft.GamingServices_4.66.30001.0_x64__8wekyb3d8bbwe to +Microsoft.GamingServices_4.66.30001.0_x64__8wekyb3d8bbwe but version ...
0
votes
5
answers
687
views
Windows CMD - How to append .txt to the names of all no-extension files in a folder and its nested subfolders?
I copied all my files from Ubuntu to a new Windows 10 computer. Many of these files (literally thousands of them) are plain text files without extensions ...
Every time I try to open one of these ...
0
votes
3
answers
308
views
Batch Rename Files by Switching Two Parts of the Name
I'm new here and don't have any coding knowledge or experience or software, but I use Windows 10. I have LOTS of files named like:(1) 2020-03-12.mp3(7) 2021-04-10.mp4(6) 2022-08-25.docxetc.They're mp4,...
1
vote
1
answer
324
views
How to batch rename Files, moving character to the end
Having previously used batch files to rename files with success, I thought this would be possible, but I just cannot get it to work for this case.
I have the following files which I'd like to rename ...
0
votes
3
answers
853
views
How can I batch rename files on Windows 7?
I have many files like these:
simple-1.gif
simple-2.gif
simple-3.gif
I want to use command prompt to rename them all with the same pattern so they look:
aa1.gif
aa2.gif
aa3.gif
I tried with this:
...
0
votes
1
answer
2k
views
How to implement regex on a powershell find and replace to quickly change file names in windows 10?
Hi I have a set of files in a folder (windows 10) that are named something like this:
asfdjlaksjfdi09908jfakl.part1.rar
aabdjkhihsdjkf.part2.rar
sdjklufia9798uiownlnsadkfasdFASDFrwe34342.part3.rar
... ...
0
votes
2
answers
5k
views
Powershell command (in batch file) to remove last 3 characters (before extension) from file name?
I have mp3 files (with names of different lengths) and want to remove the last three characters before ".mp3" for each mp3 file next to the batch file.
For example foobar043.mp3 needs to ...
0
votes
1
answer
463
views
Is there an easy way to bulk swap the file names of two files in Windows?
Is there an easy way to bulk swap the file names of two files in Windows?
I have File_A.txt and File_B.txt and after the operation, File_A.txt is now called File_B.txt, and vice versa.
:: Old Name ...
0
votes
2
answers
873
views
Move part of the filename to the front of the filename
I want to move a part of the filename to the front of the filename.
All my files have a delimiter # in them, such as: 2585#xxxxx#4157.pdf.
Now I want to move the part after the last # to the second ...
0
votes
1
answer
611
views
Rename files from different to same name with different extension
I have 12 folders with each containing two subfolders: "Images" & "Json". Now each "Images" folder has 10 image files named from 1.png to 10.png and each "Json&...
0
votes
1
answer
3k
views
Replacing characters in multiple folder and file names
I have a large movie library using Plex (Local Media Server) and have named multiple files in the wrong order. Plex will disregard square brackets when searching file names for a corresponding movie.
...
0
votes
0
answers
761
views
How to remove a section of multiple file names?
I have many files with a wildcard section I'm having to manually remove and was wondering if there was a way to do it automatically, for example I would want to rename:
Perfect Dark#43DDCBF0#2#0#...
0
votes
1
answer
117
views
Remove .txt extension from all subfolders
Is it possible to create a batch file that removes all instances of .txt extension appearing? I tried the following, but it doesn't work for me.
for f in *.txt; do mv -- "$f" "${f%.txt}&...
0
votes
2
answers
831
views
Powershell: How do I shift a date (format: yyyymmdd) from any position in the file name to end of the file name?
Currently im using
dir | Rename-Item -NewName {$_.name -replace "",""}
to rename files in a directory. The file names vary and need to be unified.
Examples for file names:
...
0
votes
1
answer
148
views
Find and replace from a different text document from each new line
I have some file conversion software that which works through cmd and doing something along the lines of:
converter.exe input.wav -o output.wav --ffmpeg "-af volume=0.1"
I'm trying to ...
0
votes
1
answer
2k
views
cmd gives me an error i was unexpected this time in a batch rename loop
I am very new to cmd and I have a problem rename a batch of .jpg files. I found this script and it gives me the error i was unexpected this time.
for i in *.jpg; do mv -i "$i" ${RANDOM}.jpg
...
0
votes
1
answer
1k
views
Make The Folder Name The Same As The File Names
I have a directory structure as below:
Folder
> FileName1.abc
> Filename2.abc
> .............
Folder2
> FileName11.abc
> Filename12.abc
> ..............
>...
1
vote
2
answers
1k
views
How to add a partial phrase to multiple file names at the same time in Windows Explorer?
I have files named 1.png, 2.png, 3.png, etc, going all the way up to 500 image files.
I intend to put a word in front of the number, so the new file names would be alpha-1.png, alpha-2.png, alpha-3....
1
vote
0
answers
94
views
Incremental renaming files in wget2
How I can rename files in incremental img001.jpg, img002.jpg,img003.jpg in below.
i tried -o, as i am downloading multiple files from text files, the files gets truncated. -o is building a one large ...
0
votes
2
answers
723
views
Using Windows rename to replace a single underscore with a double?
Can anyone advise me where I am going wrong with this? I have some file names that contain XXX XXX_Layer_XXX and I'm trying to replace to XXX XXX_Layer__XXX
My attempt so far was:
ren "*Layer_*.*...
4
votes
2
answers
3k
views
How to rename my folder and any of its subfolders into lowercase using command prompt in Windows?
I have many folders and subfolders. They have random uppercase or lowercase letters in their names. I'd like to rename all of them into lowercase version.
I see many answer here about renaming files ...
3
votes
2
answers
635
views
Batch command to rename filenames like 'The Kids Performances (2020).mp4' to 'Kids Performances, The (2020).mp4'
My family has recordings of the children's performances in school and extracurricular activities saved over the years as primarily .avi and .mp4 files. I have been asked to take all these files (there ...
0
votes
2
answers
2k
views
Best way to Delete characters from Filename after a specific string of characters in Windows
I was wondering if there's a quick an easy way to search for filenames with several characters and delete all the characters after those.
For example if I have a file called:
Great Movie Title 2021 ...
0
votes
0
answers
49
views
How to append time of creation to a file and to all WikiLinks instances where appear inside a text?
I'm using Obsidian as a zettlekasten app. I have a vault of 1000+ .md files with my notes. Some of them are linked inside other notes via wiki links. I want to change all my .md file's name by ...
3
votes
1
answer
453
views
How I can rename txt files according to first line of text file? [closed]
I have multiple .txt files and I want to rename them as first line text they contains.
First line in every text file is some number and text Example
ParagraphL23
I want my text file to be renamed as ...
0
votes
0
answers
41
views
Access is denied in one folder but not in another
I had a number of files that were downloaded from the internet and they were in Folder A.
I tried to run a .bat file on them to rename them, but on every single file I got the error Access is denied.
...
0
votes
1
answer
245
views
how can i output imagemagic image with the name of the containing folder in batch?
FOR /R %%a IN (poster.jpg) DO convert "%%a" -resize 256x256 -background none -gravity center -extent 256x256 "%%~dpna.ico"
The current behavior is to grab every poster.jpg file ...
1
vote
1
answer
575
views
Can git automatically rename files during clone/pull/commit?
We have a collection of scripts, which have, historically, had a different name-prefix depending on whether they are used in production or a lower environment.
We're switching to git now, and would ...
0
votes
1
answer
66
views
Shell - How to rename files in the midle of file name?
I have to resize images, and want to rename them on the fly
Names are like following
Compet-210-123456.jpg
Compet-210-123457.jpg
...
Compet-211-123555.jpg
and
I would like to inject 4k between two ...
0
votes
2
answers
1k
views
How can I rename a directory name replacing the first letter of each word in the name string to uppercase?
On a Windows 10 computer, I've been using free utilities like PFrank tool and Power Toys PowerRenamer. With PFrank I was able to change the case of each word in the name of the filenames to uppercase, ...
2
votes
2
answers
1k
views
batch file to rename folders creates new folders
Because I have multiple back-up copies of all files, I use the following batch file to rename files so that I don't have to go into each drive/folder to rename files manually. The batch file works ...
1
vote
2
answers
2k
views
How to rename files in all subdirectories
I need to rename all files in subdirectories. The names of the subdirectories are different, the file names are different, but they are always JPG files. I need a BAT script that will change the names ...
0
votes
1
answer
822
views
Trying to parse a string that I generate in a batch file into a few values of an XML file
I'm trying to create V2 of my little batch file. I only know batch , so I'd prefer to do this if possible instead of powershell but if I have to, I have to.
The app just copies five files that are the ...
6
votes
2
answers
889
views
What did I do wrong in my batch?
I would like to change the file extension from .jpg to .txt. This must happen both in the current folder and in all sub-folders. What did I do wrong in my batch?
for /R %%G IN (.) DO (rename *.jpg *....