‘Filename Is Too Long’ in Windows _ Fix the issue
Whether you guys have ever experienced this issue, it was likely a simple fix for you. Whether you guys have seen this error more than two times. So then you guys also know that it can also be a complex issue in order to fix it sometimes. In this guide, you will learn the way to fix the issue ‘Filename Is Too Long’.
So let’s hope you guys just run into the simple fix variety. However, we will here prepare you simply for the less easy, guaranteed-to-work fixes as well.
Why Is Filename Length Even An Issue In Windows?
Well, there is too long a history of filename lengths being an issue only for operating systems such as Windows. However, there was a time when you could not have filenames much longer than 8 characters plus a 3-character file extension. Similarly, the best you guys could do was something just like this myresume.doc. Though this was a restriction in place only by the design of the file system.
Things got better as new versions of Windows came out. We went from an old, limited, file system to something known as the New Technology File System (NTFS). NTFS simply took us to a point where a filename could also be 255 characters long. And the file path length could possibly go up to 32,767 characters. However, how we are able to possibly have filenames that are too long?
Alright! Windows has things that are called system variables. However, these are variables that Windows relies upon to function, just because the Windows will constantly know what the variables mean & where they are, even though when we are moving bits & bytes all over the place. Similarly, the system variable MAX_PATH is the one that restricts filenames & file paths to just underneath the 260 characters.
Though just being a variable, you would think we could alter it. Nope, we shouldn’t. It would also be just like pulling a thread out of a sweater. Immediately when one system variable alters, other system variables & components dependent on them begin to unravel.
How do we resolve it, then?
The Easy Fix for the ‘Filename Is the Too Long’ issue
Whether you guys are lucky, you will get the error & know exactly what file’s name is causing the problem. Or at least where to search the file. Probably be you guys must have a filename that just looks something like this:
It’s clear that who the offender is in this case. Though find the file in Windows Explorer, or File Explorer as it is just known as in Windows 10, tap once on it, hit F2 to rename it. Alter that silly filename simply to something more reasonable. Problem solved.
Also see this article: BIN Files To ISO: How To Convert BIN Files To ISO Files
The Certain fixes for the ‘Filename Is Too Long’
It is not constantly that easy to resolve this problem. Occassioanlly you probably not be able to alter the names of files or directories for whatever cause.
The following remedies will also do the trick for you. They are not tough to do.
By Using the Powershell Move, Delete, Or Copy Files Or Directories
Occasionally you guys get an error though when trying to move, remove, or copy directories. Where the character count for the file path is greater than 260.
Now you must note that the words directory & folder are replaceable. We will simply use the ‘directory’ heading forward. However, the following PowerShell cmdlets are also be able to use on files.
Probably the file path looks something like this:
However, that file path is 280 characters long. That’s why we are unable to copy the directory out of there to somewhere else with the usual copy-paste method. Though we get the Destination Path Too Long error.
So guys let’s now assume that for whatever cause. We can not rename the directories in which the file is nested. What do we have to do?
First of all, you have to head to the PowerShell.
At the time when PowerShell opens, so then you will also be at the root of your user directory. Just follow along presuming C:\Users\guymc is your user directory.
Simply the directory named This is inside the Documents directory. Just to move into the Documents directory, we simply use the DOS command cd Documents.
You guys will also see the prompt alter to C:\Users\guymc\Documents. That’s nice. We are working closer to the directories which will simply make things easier.
Copy Directory Using Copy-Item
We like to copy the directory This & its contents into ThatNewFolder. So let’s now use the PowerShell cmdlet Copy-Item with the parameters -Destination & -Recurse.
Well, guys! The Destination tells PowerShell where we desire the copy to be. -Recurse tells PowerShell to copy all the items just inside to the destination. The copying leaves the originals where they are & makes recent ones in the destination.
Copy-Item This -Destination ThatNewFolder -Recurse
Move Directory Using Move-Item
Let’s say we would just like to move the directory This, & all the directories & files in it, to ThatNewFolder. Moving doesn’t leave the real in place.
We are also able to use the PowerShell cmdlet Move-Item with the parameters -Path & -Destination. -Path simply defines that the item which we like to move & -Destination tells PowerShell where we want it.
The cmdlet will at that time put This inside of ThatNewFolder. It will also move everything, however, which is inside of the This directory. So then Move-Item is also be able to used to move files or directories. It works regardless of file path or filename length.
Move-Item -Path This -Destination ThatNewFolder
In order to make sure it worked, just use the cd ThatNewFolder command to get into ThatNewFolder. Next, use the dir command to list the directories in ThatNewFolder. However, you guys will see the This directory is in there.
Remove Directory by Using Remove-Item
Whether we like to remove the This directory, & everything in it, we use the Remove-Item cmdlet.
Similarly, the Remove-Item cmdlet also has some built-in safety. Though that just makes it hard to delete a directory with things inside of it. In our instance, we also know that we want to remove everything. Though we will use the parameters -Recurse in order to make it remove everything inside and -Force to make it perform that without asking us whether we are confirmed for every item inside.
Be alerted Recovering anything removed this way would be too tough. You are also able to try the methods in a way to Recover Accidentally Deleted Files. But do not expect much.
Remove-Item This -Recurse -Force
You are also able to use the dir command again to assure that it is gone.
Make Windows 10 Accept Long File Paths
Whether you guys know that you are heading to be using long file paths & long file names again and again. It is simple to make Windows work for you. No sense just using PowerShell to perform the work every day.
Two ways are there through which we can perform this. One is for Windows 10 Home users & the other is for Windows 10 Pro or Enterprise users. Similarly, these methods probably work for Windows 8.1 or earlier, but we are unable to guarantee that.
Make Windows 10 Home Accept Long File Paths
Well, In order to make Windows 10 Home accept long file paths, we must have to head to the Registry Editor. Whether you have not worked in Registry Editor before, be cautious. Fortuitously removing or changing things in here able to also stop Windows from working entirely.
Constantly make a backup of your registry before making any conversions.
At a time when you guys have Registry Editor opened, & your backup made, so then must navigate to the location HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem & find the key LongPathsEnabled.
Now double-click on LongPathsEnabled. Though in the Value data: field, you should make sure that the number 1 is in there. Tap OK to commit the change.
Finally, exit Registry Editor & you should be able to work with crazy long file paths here.
Make Windows 10 Pro Or Enterprise Accept Long File Paths
To let the Windows 10 Pro or Enterprise use long file paths, we are now going to utilize the Group Policy Editor. It is a tool that permits us to set policies on how Windows operates at the PC & the user levels.
Head to the Group Policy Editor by heading to the Start menu & typing in gpedit. The top result should also be the Edit group policy. So now you just have to double-click on that.
At a time the Group Policy Editor opens, also navigate to Computer Configuration > Administrative Templates > System > Filesystem. There you guys will also see the policy Enable Win32 long paths.
So now double-click on it to edit the policy setting. Alter it from Disabled to Enabled, then tap the OK button to commit the conversion.
The policy probably not take effect right away. You guys are able to also force the group policy to update.
Must read this article: How To Fix “Could Not Find This Item” Error?
Well, Guys! Some other ways are also there to work around long filenames & file paths. But what we have gone through here are the easiest, most effective procedures.