# Leading space in folder name removed on rename

**URL:** https://community.mp3tag.de/t/leading-space-in-folder-name-removed-on-rename/66660
**Category:** Support
**Created:** [November 28, 2024, 5:11pm UTC](https://community.mp3tag.de/t/leading-space-in-folder-name-removed-on-rename/66660 "2024-11-28T17:11:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![woodfold](https://community.mp3tag.de/user_avatar/community.mp3tag.de/woodfold/32/18307_2.png) [@woodfold](https://community.mp3tag.de/u/woodfold)
#### Post date: [November 28, 2024, 5:11pm UTC](https://community.mp3tag.de/t/leading-space-in-folder-name-removed-on-rename/66660/1 "2024-11-28T17:11:44Z")

</div>

This post was another report of a situation that has been replied to as **NOT a bug** as Mp3tag follows the Microsoft Specification of "File and Folder names that begin or end with the ASCII Space (0x20) will be saved without these characters." means that a folder name with leading or trailing space characters is invalid. _No action will be taken on this or similar reports_.

**Original post follows:**  
The situation I have is this:  
I have a folder who's name begins with a space, such as “ This folder name” that contains my MP3s. After editing, I rename them using the “Tag – Filename” button. When the file is renamed, it is actually moved to a new path, where all folders that had a leading space now have that space removed.  
As it turns out, you don’t actually have to do any editing, it’s the rename that moves the file.

This seems to be consistent, in that all folders with a leading space in the name have the space removed as the file is renamed, causing it to move from where it originally was to a new path.

It doesn’t seem to matter where in the folder path you have the files, the space(s) are removed when writing the entire path.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [November 28, 2024, 5:41pm UTC](https://community.mp3tag.de/t/leading-space-in-folder-name-removed-on-rename/66660/2 "2024-11-28T17:41:06Z")

</div>

This has been discussed several times including here.

> [@MP3Tag does not handle paths with a space before a folder name](https://community.mp3tag.de/t/mp3tag-does-not-handle-paths-with-a-space-before-a-folder-name/61051):
>
> Original path: X:\Music\Collection\Video Game\Nintendo\ Exclusives\Custom Robo Battle Revolution Original Soundtrack Volume 1 After tagging/renaming: X:\Music\Collection\Video Game\Nintendo\Exclusives\Custom Robo Battle Revolution Original Soundtrack Volume 1 It does not seem to save them in the source folder if there is a space at the beginning of a folder name. Instead it creates a new entire path that matches the original name and moves the files there, but without the preceding space. T…

---

<div class="post-metadata">

### Author: ![woodfold](https://community.mp3tag.de/user_avatar/community.mp3tag.de/woodfold/32/18307_2.png) [@woodfold](https://community.mp3tag.de/u/woodfold)
#### Post date: [November 28, 2024, 6:25pm UTC](https://community.mp3tag.de/t/leading-space-in-folder-name-removed-on-rename/66660/3 "2024-11-28T18:25:51Z")

</div>

Thanks, I did some searching and looked at the suggestions the forum provides but didn't see any that looked like what I posted. Maybe my searches were too specific?

All that needs to be done is to use the actual path and not massage it. Why can I make a folder with a leading space and copy it with no problem, yet it gets changed in Mp4tag? ZIP, RAR, 7Zip and many other programs all handle this fine. Windows itself doesn't change the path just because you rename a file.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [November 28, 2024, 7:02pm UTC](https://community.mp3tag.de/t/leading-space-in-folder-name-removed-on-rename/66660/4 "2024-11-28T19:02:24Z")

</div>

> [@woodfold](#):
>
> Why can I make a folder with a leading space and copy it with no problem, yet it gets changed in Mp4tag?

This was answered by the developer in the same thread linked above.

> [@MP3Tag does not handle paths with a space before a folder name](https://community.mp3tag.de/t/mp3tag-does-not-handle-paths-with-a-space-before-a-folder-name/61051/7):
>
> Yes, it's possible and not sure if we can directly infer that it's intended to be possible, though. It even was supported by Mp3tag in an earlier version. Mp3tag is reading those files, so you can see that the correct functions are used. However, there is a difference between what the file system and what the Windows Shell supports. The latter, to my knowledge, doesn't support leading whitespace characters for folder names. This is probably also the reason why those are automatically removed w…

---

<div class="post-metadata">

### Author: ![Doug\_Mackie](https://community.mp3tag.de/user_avatar/community.mp3tag.de/doug_mackie/32/279_2.png) [@Doug\_Mackie](https://community.mp3tag.de/u/Doug_Mackie)
#### Post date: [November 28, 2024, 8:09pm UTC](https://community.mp3tag.de/t/leading-space-in-folder-name-removed-on-rename/66660/5 "2024-11-28T20:09:18Z")

</div>

> [@woodfold](#):
>
> All that needs to be done is to use the actual path and not massage it.

I'm curious as to why you (or anyone) would _want_ to use leading spaces in folder names.  
If you want to force certain folders to sort to the top in Explorer, you can use the underscore character ( \_ ). Mp3tag allows it and it is far more visible.

---

<div class="post-metadata">

### Author: ![woodfold](https://community.mp3tag.de/user_avatar/community.mp3tag.de/woodfold/32/18307_2.png) [@woodfold](https://community.mp3tag.de/u/woodfold)
#### Post date: [November 29, 2024, 6:11am UTC](https://community.mp3tag.de/t/leading-space-in-folder-name-removed-on-rename/66660/6 "2024-11-29T06:11:05Z")

</div>

You guessed it, I put a space to get it to float to the top (In Total Commander) while working on a particular folder path. I used to use a "~" for the same reason, then switched to space for some unknown reason. That's when I found out it would be removed on renaming.

Since there's no interest in changing Mp3tag, I'm switching back. Case closed.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [December 29, 2024, 6:11am UTC](https://community.mp3tag.de/t/leading-space-in-folder-name-removed-on-rename/66660/7 "2024-12-29T06:11:09Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
