When naming music files I like to have them formatted like this…
“ARTIST – Title”
Is there a way to change “Artist – Title” to “ARTIST – Title” without having to retype filename?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Questions: Browsers and desktop software » Other desktop and Microsoft Store software » Any software to partially change case of file/folder name?
Have you managed to change the name manually? I ask because Windows ignores case in filenames etc. I tried changing the case of a file without success and had to do it in two changes (I added a number to the bit I wanted to change and then was able to change it back to the name and case I wanted).
I suspect this would have to be done with a batch file or Powershell script, there are quite a few who are experts in these on here.
Eliminate spare time: start programming PowerShell
Have you managed to change the name manually? I ask because Windows ignores case in filenames etc. I tried changing the case of a file without success and had to do it in two changes (I added a number to the bit I wanted to change and then was able to change it back to the name and case I wanted).
I suspect this would have to be done with a batch file or Powershell script, there are quite a few who are experts in these on here.
Never had any problem changing the case, yes, Windows does see it as the same filename (can even change it whilst the file is open) but always displays it the way I wrote it (unlike some 3rd party softwares which will change the case if saved through them).
Can you supply some sample file names and we will have a go at it.
cheers, Paul
Here’s a sample list of folders I’ve changed from…
Awolnation – Run (2015)
Faith No More – Sol Invictus (2015)
Joe Satriani – Crystal Planet (1998)
Looper – Offgrid Offline (2015)
Man Or Astroman – Inside The Head Of John Peel (1997)
Peatbog Faeries – Blackhouse (2015)
Roisin Murphy – Hairless Toys (2015)
Steve Vai – The Ultra Zone (1999)
To…
AWOLNATION – Run (2015)
FAITH NO MORE – Sol Invictus (2015)
JOE SATRIANI – Crystal Planet (1998)
LOOPER – Offgrid Offline (2015)
MAN OR ASTROMAN – Inside The Head Of John Peel (1997)
PEATBOG FAERIES – Blackhouse (2015)
ROISIN MURPHY – Hairless Toys (2015)
STEVE VAI – The Ultra Zone (1999)
The best method I’ve found so far (especially with a lot of folders) is to generate a list of the folders (I use XYplorer for this), paste the list into a Word document, highlight all the bits I want in capitals & use Words case changing function (basically what I would ideally like in the right click menu of Explorer) & then copy & pasting each folder name one at a time from Word back into the folder name.
Longwinded process I know but a quicker than doing them all manually (especially for a one fingered typest like myself).
Of all the renaming software I’ve tried so far they will only apply case changes to the whole file/folder name, not partially as I require.
Thank you for any insight you may give.
Alrock,
Here’s a little PowerShell script that will work on the directories one level under the directory your specify as a parameter.
PS: RenameDirsbyPattern.ps1
Param ( [Parameter(Mandatory=$true)] [string] $SourceDrivePath ) #Clear-Host If (Test-Path "$SourceDrivePath") { ForEach ($Dir in Get-ChildItem -Directory "$SourceDrivePath" ` -Attributes "D") { If ($Dir.BaseName.indexof('-') -ge 0) { $x = $Dir.BaseName.IndexOf('-') $temp = $Dir.BaseName.substring(0,$x-1) $NewBaseName = "$($temp.ToUpper()) $($Dir.BaseName.substring($x))" Rename-Item -Path "$SourceDrivePath$Dir"` -NewName "-$NewBaseName" -Force Rename-Item -Path "$SourceDrivePath-$NewBaseName" ` -NewName "$NewBaseName" -Force } #End If($Dir.BaseName...) } #End ForEach ($Dir...) } #End If (Test-Path...) Else { Write-Host "$SourceDrivePath is not a Valid Drive:path spec!" $ans = Read-Host "Press Enter to continue" } #End Else
To run open a PowerShell cmd window and type:
d:pathRenameDirsbyPattern.ps1 -SourceDirPath “G:Test” {replacing G:Test w/your drive directory.}
Starting Data:
41519-RenameStartingPOS
Ending Data:
41520-RenameEndingPOS
You’ll notice the two Rename-Item commands in the code. This is because PS doesn’t recognize that the folder name has been changed if you only change the case! So what I did was add a – to the front of the name in the first rename then remove it with the second rename.
If you have never run PowerShell see Post #2 Items 1-3 Here.
BTW: You’ll notice that the program did not change Test TSM as it does not have a – in the name!.
As always when testing software on your data test on a copy first! This software has NO WARRANTY!
HTH :cheers:
Alrock,
Here’s a revised version of the Powershell that will recurse through the entire directory structure starting with the directory you specify. I tried to do this last evening but was a bit too groggy to figure it out.
Param ( [Parameter(Mandatory=$True)] [string] $SourceDrivePath ) #Clear-Host If (Test-Path "$SourceDrivePath") { ForEach ($Dir in Get-ChildItem -Directory "$SourceDrivePath" ` -Attributes "D" -Recurse) { If ($Dir.BaseName.indexof('-') -ge 0) { $x = $Dir.BaseName.IndexOf('-') $temp = $Dir.BaseName.substring(0,$x-1) $NewBaseName = "$($temp.ToUpper()) $($Dir.BaseName.substring($x))" Rename-Item -Path "$($Dir.Fullname)" ` -NewName "$NewBaseName-" -Force Rename-Item -Path "$($Dir.Fullname)-" ` -NewName "$NewBaseName" -Force } #End If($Dir.BaseName...) } #End ForEach ($Dir...) } #End If (Test-Path...) Else { Write-Host "$SourceDrivePath is not a Valid Drive:path spec!" $ans = Read-Host "Press Enter to continue" } #End Else
You’ll notice, or not, that I’ve moved the added hyphen from the front of the directory name to the end of the directory name. This was necessary because as the code navigates the directories I had to be able easily append, rather than stick in the middle, the – on the second Rename-Item command. I also had to capture the Dir.Fullname each time through the loop because I could no longer depend on it being the SourceDrivePath value as the code moves through the sub-directories.
The above may or may not make sense to you but I thought I’d provide an explanation for those who may be interested.
41522-MusicRecurseTL
41523-MusicRecurseSL
HTH :cheers:
That’s a slick little piece of code there RG. I’ve been trying to learn PS and this is helpful.
B.
Thank you…Thank you very much!
We’re in the same boat as I learning it also. Just keep on plug’n, google’n, experment’n, and of course Lounge’n as we say in the South! :cheers:
Tried it but something went wrong somewhere…
Copy & pasted your 1st code into notepad & renamed file to RenameDirsbyPath.ps1 as per your instructions…
1st attempt got an error about execution of scripts being disabled, so Googled that & then tried again…
2nd attempt…
Windows PowerShell Copyright (C) 2009 Microsoft Corporation. All rights reserved. PS C:Windowssystem32> set-executionpolicy remotesigned Execution Policy Change The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution policy? [Y] Yes [N] No [S] Suspend [?] Help (default is “Y”): y PS C:Windowssystem32> I:RenameDirsbyPattern.ps1 -SourceDirPath “H:MP3” I:RenameDirsbyPattern.ps1 : A parameter cannot be found that matches parameter name ‘SourceDirPath’. At line:1 char:42 + I:RenameDirsbyPattern.ps1 -SourceDirPath <<<< "H:MP3" + CategoryInfo : InvalidArgument: (:) [RenameDirsbyPattern.ps1], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,RenameDirsbyPattern.ps1
Will try & figure out where I went wrong but since it is pretty much double dutch to me, any pointers would be handy.
If you are interested in an alternative approach and, you are familiar with Bulk Rename Utility. (BRU), you might try BRU.
Here is an example;
From: Applause โ Lady Gaga (with Vocals).cdg
From: Applause โ Lady Gaga (with Vocals).mp3
To: Lady Gaga (with Vocals).- Applause.cdg
To: Lady Gaga (with Vocals).- Applause.mp3
This is what you have to do in BRU.
1. Set RegEx (1) as:
MATCH: (.*?)-(.*)
REPLACE: 2 – 1
2. In the Remove (5) field, check “Trim” (that’ll remove any spaces left at the beginning of the file name).
3. Use the preview to see if everything’s OK, and then press “Rename”.
See attachment for result.
Once you get the hang of it, you have lots of power.
Best wishes,
Michael
41555-Reverse-Artist-Title-Names-with-BRU
Alrock,
My bad! I typoed in the instructions!
This: d:pathRenameDirsbyPattern.ps1 -SourceDirPath “G:Test”
Should have been this: d:pathRenameDirsbyPattern.ps1 -SourceDrivePath “G:Test”
Sorry! HTH :cheers:
Alrock,
My bad! I typoed in the instructions!
This: d:pathRenameDirsbyPattern.ps1 -SourceDirPath “G:Test”
Should have been this: d:pathRenameDirsbyPattern.ps1 -SourceDrivePath “G:Test”
Sorry! HTH :cheers:
Still not working for me… However, refusing to be beat I returned to my usual Renaming software fueled with a renewed determination to figure out just how to do it… Finally solved the puzzle, steps below for anybody interested…
Nothing can be better than a dedicated script, but I find this to be a good, general-purpose renamer. It shows you what your filenames will look like BEFORE you commit the rename process, which is wonderful. There’s also an Expert mode:
http://www.bulkrenameutility.co.uk has a powerful, free utility for renaming groups of files (bulkrenameutility.exe).
ZtreeWin is like the old DOS Xtree in its user interface. It is a great disk and file management tool that enables touch typists to be highly productive.
To change a file name, I point at the file, press r (for rename), then type a new name, or to just change the case, press the tab key repeatedly to cycle through proper case (first character capitalized), lower case and upper case.
See http://www.ztree.com/html/ztreewin.htm
It is modestly priced shareware. If you have a bunch of files to rename, you could use it just for that, then if it is not not useful for other things to you, just quit using.
Here is from the home page, in case you don’t want to click the above link:
[TABLE]
[TR]
[TD][/TD]
[TD=”width: 557″] [TABLE]
[TR]
[TD=”width: 557″] ZTreeWin is a fast and flexible text-mode file/directory manager for all versions of Windows. It has been developed as the successor to the legendary DOS file-manager XTreeGold. Anyone who has used that remarkable program would be aware of its superior capabilities as a text-mode, tree-structured file-manager – but would also likely be aware that its limited memory support, and lack of long filename support are today a major issue.
ZTreeWin is a native Windows program (both 32-bit and 64-bit) that has been developed to provide all the powerful functionality of the past (and much more!), while avoiding all the limitations of the old DOS-based program. A few advantages of ZTreeWin:
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[/TR]
[TR]
[TD] ZTreeWin is available in two versions: v2 for Windows NT, 2000, XP, Vista, 7,8 & 10 (both 32-bit and 64-bit), and v1 for Windows 95, 98 & ME.
Read some of our customer testimonials.
[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]
[TABLE]
[TR]
[TD=”width: 50″][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD=”width: 464″] [TABLE]
[TR]
[TD=”width: 36″] [TABLE=”width: 100%”]
[TR]
[TD=”align: center”][/TD]
[/TR]
[/TABLE]
[/TD]
[TD=”width: 419″] Now available for download: v2.2
[/TD]
[TD=”width: 9″] [/FONT]
[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]
[TABLE=”width: 598″]
[TR]
[TD=”width: 25″][/TD]
[TD=”width: 157″][/TD]
[TD=”width: 416″][/TD]
[/TR]
[TR]
[TD][/TD]
[TD=”class: TextObject, width: 573, colspan: 2″] Here is just a sample of the enhancements in v2.x:
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD=”width: 333″]
[/TD]
[TD=”width: 284″] The now-standard “tree-structured” hierarchy of directories, invented by XTree, is displayed in the top left corner, the files contained in the highlighted directory listed below left, disk and file statistics on the right side, and keyboard-command menus at the bottom.
And ZTreeWin retains the fast keyboard-command text-mode response that XTree pioneered and file management professionals still demand.
ZTreeWin also adds many other sophisticated tools, such as case-specific renaming functions, copy & paste facilities, and file type coloring, that are not only possible but essential to modern 32-bit and 64-bit systems.
[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]
[TABLE]
[TR]
[TD=”width: 31″][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD=”width: 639″] [TABLE]
[TR]
[TD=”width: 262″]
[/TD]
[TD=”width: 364″] ZTreeWin is a true 32-bit/64-bit application that makes use of that environment to bring best-in-class, high performance keyboard-command text-mode file management to the demanding professional level.
It’s all about productivity! ZTreeWin provides fast, mnemonic access to all commonly needed file-management tasks, as well as unlimited command history, and macro recording and playback. Any task you do with ZTreeWin can be made extremely easy to do again in the future.
ZTreeWin is becoming the most productive, vibrant, and growing disk and file management utility by addressing the needs of today’s professionals with a very responsive dialog and development effort while building on well established and time-proven methods and procedures.
[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]
When naming music files I like to have them formatted like this…
“ARTIST – Title”
Is there a way to change “Artist – Title” to “ARTIST – Title” without having to retype filename?
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.