Pular para o conteúdo principal

Long Paths and Root Mapping

There is an old restriction from the 1990s in the Microsoft Windows OS that limits the maximum file path to 260 characters. This limit is too low in modern work environments, and users can easily reach this limit.

Example of a root folder that can hit the limit: M:17\_Underground Mining173\_Geotech111\_Data5.4\_GeotechnicalSeismicitymXraproot\_minesite

The start of the path uses 90 out of the 260 limit, leaving only 170 characters for folders and files inside the data folder.

Please note that this issue is not mXrap specific so you may experience other programs having issues with this too - including with Windows Explorer.

If you want to read more about long file paths, you can do so here:
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

How do I know if I'm affected

  • You will not be able to open, rename or delete files with MS File Explorer.
  • mXrap and mXsync will have trouble reading and writing files, resulting in:
    • mXsync continuously rescanning the same files
    • mXrap is blocked and the System Health Menu mentions 'Long Paths', 'Can't scan file' or 'Error while reading file'
    • mXrap error console or popup appears and mentions 'Long Paths', 'Can't scan file' or 'Error while reading file'
Long Path Alert
Long Path Alert

How do I enable long paths

You can enable long paths by updating the window registry on your device. This will require administrator permissions so please contact your IT department as required.

Via Windows Registry Editor

Open Registry Editor
Open Registry Editor
  1. Navigate to the Start Menu or Search bar on the bottom left and type 'Registry Editor'

  2. Click on the 'Registry Editor' program

    Update_LongPath_Registry
    Update_LongPath_Registry
  3. Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

  4. Check if LongPathEnabled is set to 1. If not, double click the Name (ie. LongPathsEnabled)

  5. Edit the Value data to be 1 and click 'OK'

  6. Restart mXrap and check if you are still having issues

Via Powershell

Open_PowerShell
Open_PowerShell
  1. Navigate to the Start Menu or Search bar on the bottom left and type 'PowerShell'

  2. Right-click and 'Run as Administrator'

    Update_LongPath_Via_PowerShell
    Update_LongPath_Via_PowerShell
  3. Copy and paste the following text in PowerShell and hit enter on the keyboard:


New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

  1. Restart mXrap and check if you are still having issues.

Temporary workaround

If you have requested IT to enable long paths, it is best to wait for them. If you urgently need to look at your root, you can map the folder containing your root folder to a drive. You can do so by following the instructions below:

  1. Navigate to the Start Menu and search for and open 'Command Prompt'

    Open_Command_Prompt
    Open_Command_Prompt
  2. In Command Prompt, copy and paste the following text:

net use x: root_folder_parent /PERSISTENT:YES

Notes:

  • Please substitute the text root_folder_parent to be the path to the folder containing your root folder like the example below.

  • The root_folder_parent must be a folder on a network drive.

    • If you have an issue with the root on local disk, we would recommend moving the root so it will have a shorter path.
  • Please ensure the X: drive is currently unused on the computer before proceeding, otherwise you can use another letter that is currently unused.

    Map_Drive
    Map_Drive
  1. Hit 'Enter'

After mapping the drive, we will need to update mXrap to use that path instead of the original full path:

  1. Open mXrap

  2. If you have opened the root folder in mXrap before;

    1. Select the root folder

      Select_Root_mXrap
      Select_Root_mXrap
    2. Select Switch>Forget this Root

      Forget_Selected_Root_mXrap
      Forget_Selected_Root_mXrap
  3. Select Switch>Add a Root
    Make sure to select your root via the new mapped drive (X:). Don't use the old path as it will trigger the problems with Long Paths.

    Add_Root_mXrap
    Add_Root_mXrap
  4. Repeat if you have multiple roots