Last Updated: November 20, 2017
· icflorescu

Solving the "source path too long" NTFS issue


Source path too long error in Windows

If you're trying to delete a folder or file and Windows keeps barking at you "Source path too long", use rimraf command line utility instead.

The problem

Sometimes you end up having large folder trees on your hard drive that NTFS simply can't delete. Web / Node.js developers happening to work on Windows are probably aware of this issue (why would a Web / Node.js developer be working on Windows is a good question and the subject of another story).

This may look like a minor issue, but really can be a show-stopper if you're trying to use Node.js apps on Windows.

Leaving aside the technical mystery of how is the OS able to create those files but cannot delete them, here's how sane people would try to solve this problem:

File Explorer - Delete

Trying File Explorer - Delete

Nope. Can't do it.

File Explorer - Shift+Delete

I know. If it's too long for Recycle Bin, I'll just use Shift+Delete.

Trying File Explorer - Shift+Delete - Step 1

Trying File Explorer - Shift+Delete - Step 2

No, it doesn't work. Hmmm...

Command prompt

I'm a technically-literate person, so I'll use rmdir in Command Prompt.

Trying the Command prompt - step 1

Trying the Command prompt - step 2


The insane way: access the drive from a different OS

People happening to dual-boot their computers will be able to remove the stubborn file / folder by mounting the drive in Linux. It's impractical, though, even for geeks.

What you should do

Node.js developers may be familiar with a cool little useful NPM called rimraf. Although rimraf is mostly used in Node.js application scripts, it does have a command-line utility. Which means you can install it globally like this (assuming you already have Node.js installed):

npm i -g rimraf

Then you can simply use rimraf instead of rmdir, like this:


Say Thanks

14 Responses
Add your response


Well, I see no point in using Long Path Tool or any other paid app when my workflow already includes Node.js and there's a free and faster command-line alternative in the ecosystem.

over 1 year ago ·

just try duplicate files deleter, it is a great solution of that issue....

over 1 year ago ·

Long Path Tool help me a lot when i have an issue like file deleting or renaming the file. Also good to use if file name and file extension is too long

over 1 year ago ·

“Long Path Tool” is very helpful for this error !
You can use to solve this problem

over 1 year ago ·

Long Path Tool help me a lot when i have an issue like file deleting or renaming the file. Also good to use if file name and file extension is too long.

over 1 year ago ·

This is the right solution to this issue by far! I never thought to find the answer in a web developer site. Thank you very much, you guys made my day.

over 1 year ago ·

“Long Path Tool” is very helpful for this error !
best solution for your problem.

over 1 year ago ·

So much shameless advertising about that "long path tool" or whatever it's called...

over 1 year ago ·

Thank you,
Long path tool is the very good program for error, unlock solution.
Try it and solve your problem.
I used long path tool and I solve my error, unlock problem solution.

over 1 year ago ·

Hello everyone,
I suggest everyone a software which can solve this problem. The name of the software is Long Path Tool.

11 months ago ·

Hey I suggest that you try Long Path Tool.

It´s a great tool to to fix the message that say "The specified file or folder name is too long. The URL path for all files and folders must be 260 character..."

I used it and had a good and fast solution to my problem.

Highly recommendable.

10 months ago ·

FastCopy is open source C project written by SHIROUZU Hiroaki and is "The Fastest Copy/Delete Software on Windows." It supports UNICODE and filename and path that are normally too long. How to use -

7 months ago ·

I would also recommend using Long Path Tool. It's the best help you can get

7 months ago ·

I would also recommend the long path tool . Some says it don't work but it really work perfectly fine for me. :)

about 2 hours ago ·
Awesome Job

B6c77ad0 c95b 11e7 8263 8f89080b8db6
Ruby Developer Backend
Austria (Vienna or Linz)
Full Time