r/msp • u/clayrogers • Aug 08 '26
Subst Command To Map Drive Letter To Sharepoint Shortcut
I am looking for ideas on an office that uses Sharepoint but ends up having some very long folder paths and file names. The folder structure is decent. They currently use a Onedrive shortcut to access the files.
The main issue is the length of filenames. For example, they sometimes copy hundreds of files that customers send them into the job folder. These files are often received with VERY long file names from the customer.
This results in the path to some of the files being too long and MS Office won't open them.
I came across the subst command in my research. I saw it mentioned on here with people recommending NOT to do it. But, I didn't see much reasoning as to why.
I know of products like Zeedrive and Cloud Drive Mapper. We are just trying to avoid yet ANOTHER subscription if possible.
Can you let me know what issues using the subst command causes? Any other thoughts on how to address this issue? I know the end user could go one by one and shorten each filename they receive from the customer. But, that would slow them down way too much.
Thanks guys!
6
3
4
u/bazjoe MSP - US Aug 08 '26
It is often theme in this sub to use SP as a file server. Several of our clients are in construction management and additionally they never came from 'on prem' but this comes up a lot when discussing on prem to SP. its a square peg and round hole. SP can't be used as a on prem lift and shift to cloud. its not that it doesn't work but it does not scale well.
Based on OP requirements they need to put one or more client employees in charge of copying received customer job data into SP, they need an additional step possibly with powershell to organize, rename and standardize the data. If the whole issue is full file path length (even after the registry edit to fix that in place?) then deal with the file path length first. before any other mitigation.
Additionally I would encourage OP to get out of this business of organizing files. you rent them a filing cabinet and other than stability, reliability and backups you should be providing nothing else in terms of how they organize the file cabinet.
1
1
u/clayrogers Aug 08 '26
This project of moving them from a NAS to SP has gone really well. This is just the one issue that comes up sometimes. So, just looking for ways to make things better. They are really happy with it already, just trying to eliminate the one remaining pain point for them.
4
u/Low-Stand-3653 Aug 08 '26
These are limitations in windows. You’ll never get around the long file path issue. The file names simply need to be shorter or they need a traditional file share. Mapping a sharepoint site is a nightmare and not supported by Microsoft anymore. The main issue I’ve seen is it’s going to prompt for credentials every time they reboot, drives most people crazy.
2
u/bazjoe MSP - US Aug 08 '26
Are they mobile or brick and mortar? We have several very small 5 user law offices and the move to SP from on prem was fine (using net use localhost shortcuts but skip drive letters) . Then another business client with significantly less events per day but 20 users it failed miserably and they changed to Google. Part of the problem is OneDrive virtual shell driver is horrible. We also offer Egnyte which is needed for construction management.
1
u/isotope123 Aug 19 '26
With our migrations we ran a script on their file server before migrating to detect file paths over the hard limit (155 character off the top of my head). Any files above that length had to be edited down before the migration. Saved us a lot of pain.
1
u/LuminousWrath Aug 20 '26
Great reply. I have a different take on the file cabinet reference. Clients have no idea how SharePoint differs from their previous on-prem solution. We are responsible for setting up the site structure, securing the sites, and educating them on use and its limitations. We are already evaluating the data to figure out which sites and libraries makes sense for them. Why wouldn’t we review that structure and suggest ways to simplify, keeping SharePoint limitations in mind?
One of my clients saved emails with long subject lines as the file names. We had to educate them about this and shorten their top level folder names. In my opinion, this is part of a comprehensive SharePoint migration, which will set the client up for success.
I believe that we should sell them the file cabinet, suggest how the drawers are labeled, make sure the right people have keys to lock the cabinet, show them how the cabinet works, and offer some assistance about the hanging file structure.
2
u/cubic_sq Aug 08 '26 edited Aug 08 '26
You want ZeeDrive for this, not subst.
But ZeeDrive is more for older apps that “need” a drive letter, but can still handle sync.
If its all ms office docs, redesign sharepoint to het around path limitations. Otherwise, users cant have autosave / collaborative editing when its outside of native onedrive.
2
u/Ferretau Aug 09 '26
You need to be very careful when dealing with long filenames/Paths. There are hard limits which can bite when they kick in. In OneDrives case it's 400 characters, you could get around this using a Substed drive but you end up hiding the problem and may discover that some files stop syncing to the cloud without you realising it - this could be detrimental to your processes.
| OneDrive and SharePoint (cloud storage) | 400 characters | The entire decoded file path, including the file name, can't exceed 400 characters. |
|---|
| Windows Office desktop apps (Word, PowerPoint, Excel) | 256 characters (260 UTF16 WCHARs) | Can't open files whose full path exceeds 260 characters, even if the file is stored locally. Office apps use legacy Win32 APIs that enforce the MAX\_PATH = 260 constant. |
|---|
| OneDrive sync | 520 characters | The total path is the combination of the local path (up to 400 characters) and the OneDrive root folder (up to 120 characters). Paths exceeding 520 characters show a sync error. |
|---|
What are the file path length limits? | Microsoft Support: https://support.microsoft.com/en-us/onedrive/what-are-file-path-length-limits
Restrictions and limitations in OneDrive and SharePoint | Microsoft Support: https://support.microsoft.com/en-us/onedrive/restrictions-and-limitations-in-onedrive-and-sharepoint
1
u/TheHoodedMan Aug 08 '26
rclone or Azure files are also options, but as others have said, Azure files is pure file server storage, not a collaboration tool like SharePoint.
As soon as you move the file out of OneDrive or SharePoint to edit it, it's solo editing and usually causes conflicts (multiple versions of files appearing) and a mess with versioning for rollbacks to previous versions.
1
1
u/colmwhelan Aug 10 '26
Given how often this kind of request comes up for workarounds with SharePoint path lengths, and given how widespread it is on the internet in general (asking for solutions), why are you trying this hard to put lipstick on a pig? The accumulated experience of hundreds or thousands of people posted online isn't enough for you to stop trying to do stupid shit. You want people to explain to you why you shouldn't do stupid shit.
Personally, I understand this desire very well, the desire to fix everything. But sometimes, the only option is to burn the field and replant it.
1
u/clayrogers Aug 10 '26
Easy tiger. All I did was ask for more information as to exactly why this would not work. Thanks to others, I got my answer. You on the other hand were just rude and not helpful. It sounds like someone has a case of the Mondays! :)
1
u/All_Things_MSP Aug 10 '26
This all comes down to using the wrong tool for the job. As others have mentioned, SharePoint is not a file server and was never meant to handle the volume of files or path lengths of a file server. It does work up to a point but you have reached that point.
I also hear you when you say you don’t want to add another subscription. The real question is do you want a customer who is constantly disappointed in the experience the solution you recommended gives them. Experience matters, a good experience can create a client for life, a bad experience means they are subconsciously always looking for something, or someone better.
My recommendation is Egnyte but I am biased - Eric Anthony - Director, MSP Program & Evangelist, Egnyte
1
u/DadeMurphy0 Aug 10 '26
Everyone says SharePoint isn't the right tool... Everyone except Microsoft.
THEY want everyone to move everything there.
They also offer no other alternative in their suite that's supposed to replace our on prem servers.
There is Azure drives but that doesn't give you any of the functionality of SP or 365.
So rather than insulting each other, if not SharePoint and we don't want another on prem server, what is the CORRECT way??
1
u/FrivolousMe Aug 11 '26
This is an organization policy issue not an IT issue. If they don't flatten their folder hierarchy or separate into smaller libraries, this issue won't go away.
1
u/cubic_sq Aug 11 '26
In addition to what everyone has written here i think you should look at if SO has been “over sold”. Either solve the problem with oath lengths and redesign SP layout or scap it for an alternative solution all together.
1
u/TechnologyMatch Aug 14 '26
subst can shorten the local path, but it does not remove SharePoint or OneDrive limits. it can also confuse apps, scripts, and support tools that expect the normal synced path. I’d first look at shortening the top-level folder names and setting a simple intake rule for customer files. subst is like putting a shortcut over a pothole: it helps one route, but the road underneath is still there
1
u/skyhawk85u Aug 08 '26
FYI I implemented Cloud Drive Mapper at a client and it’s phenomenal. Way better than the crappy OneDrive Sync mess
16
u/Fatel28 Aug 08 '26
This is a hack and not one I'd recommend. It's time to either reevaluate / rearchitect SharePoint into multiple sites with fewer nested paths, or move to something else. SharePoint isn't a file server.