Skip to content

Est. 2011ยทMicrosoft Partner 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

Free Fix 0x80070052

Error 0x80070052: the directory or file cannot be created on a share

11 min read Updated October 5, 2026 Networking, Sharing & Printing

Fix it now

0x80070052 is Win32 82, “The directory or file cannot be created”. It is a creation failure, not a permission failure: the account has the rights it needs, but something about the name, the path or the destination makes the entry impossible to create. Name, path length and destination limits account for nearly all of it.

  1. Create a file called test.txt in the same destination folder. If that succeeds, the problem is the name or the path length, not your permissions.
  2. Count the whole path, not just the file name. A path beginning with a server and share name spends a good part of the budget before your own folders start.
  3. Check the name for characters the file system will not accept, for a trailing dot or space, and for reserved device names such as CON or LPT1, which stay reserved even with an extension added.
  4. Map a drive to a folder further down the tree, so the path the application sees starts there and is much shorter. That is the fastest real fix on a share.
  5. Check whether a quota applies to the destination folder or to the user, and how much of it is left. A quota reports free space differently from the volume.
  6. If you are writing to the very top level of a share on removable media or an older file system, create a subfolder and write into that instead.

Test as the affected user, not as an administrator. An administrator with a short home path and no quota will succeed at every one of these tests and prove nothing.

If the file saves under its real name to the real destination, you are done. If not, the next section narrows down which of the four limits you have hit.

Why it happens

Creating a file asks the file system to add an entry to a directory, and that can fail for reasons that have nothing to do with who you are. The name may contain something the file system cannot store. The full path may be longer than the interface used to create it can express. The directory itself may be unable to take another entry, which is a real limit on the root of some older file systems and on some appliance file systems. Or a quota may have been reached, in which case the write is refused however generous the permissions read.

Path length is the most common of these on a share, because a network path spends characters before it starts. The same tree that works locally under a short drive letter can exceed the limit through a server and share name, which is why the failure follows the route rather than the data. Windows can permit longer paths, but each application also has to be built to use them, so it is not the quick win it looks like.

The neighbouring codes distinguish the near misses, and it is worth reading which one you actually got. 0x80070050 is Win32 80, “The file exists” – a collision rather than a refusal, and it can be caused by a name differing only in case. 0x800700A1 is Win32 161, “The specified path is invalid.” 0x8007006F is Win32 111, “The file name is too long.” The fourth, 0x80070051, has no published meaning at all: decimal 81 is simply absent from Microsoft’s error list, which runs from 80 straight to 82.

The name contains something the file system will not take

You have this one if Files with plain names save fine, and the failures have something in common, such as a colon or a name generated from a document title.

  1. Strip reserved characters from any name your process generates, rather than hoping the source stops producing them.
  2. Remove trailing dots and spaces. Some interfaces accept them and others refuse, which is why the failure looks arbitrary.
  3. Avoid reserved device names, which stay reserved when an extension is added.
  4. Where names come from a system that allows characters Windows does not, map them deliberately.

The path is too long

You have this one if The same file saves under a short local path and fails under the network path, and the folder tree is deep.

  1. Map a drive directly to a folder well down the tree so the effective path is shorter, and use that mapping for the work.
  2. Shorten folder names in the deepest part of the structure. One long project folder name repeated at several levels is often the whole problem.
  3. Where tooling supports it, enable long path support, and confirm the specific application honours it before relying on it.
  4. Use a copy tool that reports path lengths so you can find the offenders instead of hunting them by hand.

Enabling long path support changes behaviour for the whole machine and only helps applications built to use it. Shortening the structure is less elegant and works everywhere.

A quota has been reached

You have this one if A short name also fails, the destination has plenty of free space, and only some users are affected.

  1. Check for a folder quota on the destination on the server, and for a per-user quota on the volume.
  2. Read how much of the allowance is left rather than assuming, since a quota reports free space differently from the volume itself.
  3. Raise the quota, or move the data, once you know which one applied.

The directory cannot take another entry

You have this one if Writing to the top level of a share fails while a subfolder works, often on removable media or an appliance.

  1. Create a subfolder and write into that. It is not so much a workaround as the correct structure.
  2. On removable media formatted with an older file system, copy the contents to a volume with a current file system if the tree is large.
  3. On an appliance, check the manufacturer’s documentation for limits on files per directory and on name length.

A name collision that is not visible

You have this one if 0x80070050, or the destination looks empty but refuses one specific name.

  1. Show hidden and system items in the destination before concluding it is empty.
  2. Check for a name differing only in case. A file system that ignores case treats those as the same name.
  3. Check for a folder with the name the file wants, which blocks the file just as another file would.

Full reference

The five codes, and the one that is not documented

Code Win32 Published meaning
0x80070052 82 The directory or file cannot be created
0x80070051 81 Absent from Microsoft’s published error list, which runs 80 then 82. No meaning is published
0x800700A1 161 The specified path is invalid
0x8007006F 111 The file name is too long
0x80070050 80 The file exists

It is worth being blunt about 0x80070051. Advice that assigns it a meaning is inventing one. If it is what you have, work through the same list of causes as for 0x80070052 – name, path length, destination limits, quota – and do not let anyone tell you the number narrows it down.

Narrowing it down quickly

Test What the result means
A short name in the same folder works The name or the path length is the problem
A short name also fails The folder, the quota or the file system, not the name
It works locally on the server, fails over the share Path length, because the network path is longer
It fails only for one user A per-user quota rather than a permission
It fails only at the top level of the share A limit on that root directory. Use a subfolder
The application reports the file exists A collision, possibly differing only in case

Reserved names and characters

The rules here are old and are not going to change, so it is worth knowing them once rather than rediscovering them per incident.

  • Reserved device names such as CON, PRN, AUX, NUL, COM1 to COM9 and LPT1 to LPT9 cannot be used as file names, with or without an extension.
  • A name may not end in a dot or a space. Some interfaces accept the name and strip it silently, others refuse, which is why the same operation succeeds in one application and fails in another.
  • The characters reserved by the file system cannot appear in a name, and a name generated from a document title or an email subject is the usual way one sneaks in.
  • Case is not significant on a Windows file system, so two names that differ only in case are one name.
  • A folder and a file cannot share a name in the same directory.

The path length problem, in practical terms

The well-known limit is 260 characters for a path expressed through the ordinary interface, and the important part is that it counts everything. A share reached as \\fileserver01\departments$\finance has already spent a good share of the budget before the user’s own folder structure begins, which is exactly why the same tree is fine on the server and fails over the network.

  1. Map a drive as deep into the tree as the work allows. Every level you skip is characters back.
  2. Rename the offending levels rather than the leaves. One long name repeated at four levels costs four times as much as a long file name once.
  3. Check what the application does. Some create temporary files alongside the target with longer names, so a path that fits can still fail on the save.
  4. Only then consider enabling long paths, and test the applications that matter before relying on it.

Enabling long path support affects every application on the machine, and some older software behaves unpredictably once paths exceed what it expects. Export the branch before changing it, test with the applications that matter, and prefer restructuring the folder tree where you can.

Every code this article covers

Code What it points at Source
0x80070052 Win32 82, ERROR_CANNOT_MAKE: the directory or file cannot be created Microsoft Learn
0x80070051 Decimal 81 is absent from Microsoft’s published Win32 error code list, which runs from 80 to 82. No meaning is published for it, so diagnose it with the same list of causes as 0x80070052 not published by the vendor
0x800700A1 Win32 161, ERROR_BAD_PATHNAME: the specified path is invalid Microsoft Learn
0x8007006F Win32 111, ERROR_BUFFER_OVERFLOW: the file name is too long Microsoft Learn
0x80070050 Win32 80, ERROR_FILE_EXISTS: the file exists Microsoft Learn

Confirm the fix worked

  1. Save the file that was failing, under its real name, to the real destination.
  2. Create and delete a test file at the deepest point of the tree that is actually used.
  3. Confirm quota headroom on the destination if a quota was involved.
  4. Repeat the operation as the affected user, not as an administrator.
  5. If you shortened a mapping or a folder name, confirm anything that referenced the old path still works.

Questions people ask about this

Does anything here need to be bought?

No. This costs nothing to fix. Every cause is a naming, path or quota question, and all of them are settled with configuration or by restructuring folders.

Is this the same as access denied?

No, and confusing the two wastes hours. Access denied means the permission stack refused you. This one means the destination could not create an entry with that name even though you were entitled to try.

Should I just enable long paths everywhere?

Be careful. It helps only applications built to use it, and older software can behave oddly once paths grow beyond what it was written for. Shortening the tree is more reliable where it is possible.

Why does the failure follow the share and not the file?

Because a network path is longer than the local path to the same folder. The server and share name are counted, so a tree that fits locally can exceed the limit over the network.

I am getting 0x80070051 rather than 0x80070052. Does that narrow it down?

No. Microsoft publishes no meaning for it – decimal 81 is not in the error list at all. Work the same causes.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

License Error Scan to folder fails with 0xC00000CC: the copier cannot reach your share License Error Error 0x80072746: endpoint security resets SMB, print and RDP connections Free Fix Error 0x0000007C: printer driver or print processor not supported by Windows License Error Remote Desktop error 0x204: we couldn’t connect to the remote PC
โ† Back to Knowledge Base