Problem deleting directories and files in Windows

I was trying to delete a folder containing some node modules that was extremely deeply nested and kept getting errors to do with the file path being too long when using the standard File Explorer delete tools. I eventually found a solution at http://stackoverflow.com/questions/28175200/unable-to-delete-node-modules-folder.

Create an empty folder somewhere, e.g. C:\test. Open up a command window and run the command 'robocopy /MIR c:\test <directory to delete>. The directory will now be empty and can itself be deleted.

The /MIR switch makes robocopy copy the contents for the source directory (the empty one in this case) to the destination folder and delete any existing directories and folders in it.

Comments

Popular posts from this blog

Path environmental variable on mac

Setting up node-sass on a mac