Accessing and Deleting Long Filenames & Paths
Total Page:16
File Type:pdf, Size:1020Kb
Accessing and Deleting Long Filenames & Paths If you have ever run into an issue accessing, deleting, or installing a file where the path is over 255 characters then this is the document for you. Typically this presents itself as either “File is too long”, or “Inaccessible” (see Figures #1 & #2). Figure #1 – File Name Too Long Error Message Figure #2 – Destination Path Too Long Error Message Windows uses a convention called “Long Filenames” (LFN). Now that Windows 10 has finally added the ability to remove that limit. You just have to make a quick change to the Registry or Group Policy to make it happen. 888.688.3234 | GOENGINEER.COM There are a couple options to fix this issue. 1. Shorten folder & file names to get under the 255 character limit. 2. Use the DOS 8.3 Filename System: a. DOS 8.3 means 8 characters for the file name and 3 character extension. b. Open a CMD prompt in a parent folder. c. Enter “DIR /X” i. This command will show both the 8.3 and long filename. Then you can use the 8.3 filename to delete the file and then also potentially the folders also. 3. Use the Subst command to create a mapped drive to a specific path. a. Navigate to the path in Windows Explorer and then in the address bar type “subst x: .” and press Enter. This will open a command window briefly and then close and create a new mapped drive letter (x in this case). This new mapped drive letter will be pointing at the previous path but now will allow you to access the files. b. Once you are done, open a command window and enter the command “subst /d x:”. This will remove the mapping. Then close Windows Explorer and re-open and the mapped drive will be gone. 4. Edit the registry or use group policy to enable support for LFN in Windows 10. a. Windows 10 Home i. Open the Registry Editor (regedit.exe) ii. Navigate to the key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem” iii. On the right, find a value named LongPathsEnabled and double-click it. If you don’t see the value listed, you’ll need to create it by right-clicking the FileSystem key, choosing New > DWORD (32-bit) Value, and then naming the new value LongPathsEnabled . iv. In the value’s properties window, change the value from 0 to 1 in the “Value data” box and then click OK. b. Windows 10 Pro & Enterprise i. Hit Start, type gpedit.msc, and press Enter. ii. In the Local Group Policy Editor, in the left-hand pane, drill down to Computer Configuration > Administrative Templates > System > Filesystem. On the right, find the “Enable win32 long paths” item and double-click it. iii. In the properties window that opens, select the “Enabled” option and then click “OK”. iv. You can now exit the Local Group Policy Editor and restart your computer (or sign out and back in) to allow the changes to finish. If at any time you want to reverse the changes, just follow the same procedure and set that option back to “Disabled” or “Not Configured.” 888.688.3234 | GOENGINEER.COM .