Recently, while working on one of the project we installed a utility from node.js. After playing around with the said utility / tool, when we tried to delete the folder, it started throwing the below mentioned error :-
The reason for this error is that Windows has a number of rules on the maximum lengths possible for directory names, path names and file names. The maximum length for a Windows path name is generally 260 characters.
After doing a lot of head hunting, we used the following process to delete the folder.
1. Create a folder anywhere in your system to use as a source (leave it empty).
2. Take back up from the folder you want to delete (if there is something important)
3. Open Command prompt
4. Type the following command. Modify the placeholders to suit your needs.
robocopy C:\path-to-source-empty-folder E:\path-to-folder-you-cant-delete /purge.
Note: If there are spaces in source or destination path in Step 4, the path must be enclosed by quotation marks.
5. After successful execution of the command, you will get execution report like the following
6. Everything inside the destination folder will be deleted forever.
You can also type robocopy in command prompt to see other options. Leave your comments to share which robocopy option you used.
If you enjoyed this post, We would be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter or Facebook. Thank you!
The reason for this error is that Windows has a number of rules on the maximum lengths possible for directory names, path names and file names. The maximum length for a Windows path name is generally 260 characters.
After doing a lot of head hunting, we used the following process to delete the folder.
1. Create a folder anywhere in your system to use as a source (leave it empty).
2. Take back up from the folder you want to delete (if there is something important)
3. Open Command prompt
4. Type the following command. Modify the placeholders to suit your needs.
robocopy C:\path-to-source-empty-folder E:\path-to-folder-you-cant-delete /purge.
Note: If there are spaces in source or destination path in Step 4, the path must be enclosed by quotation marks.
5. After successful execution of the command, you will get execution report like the following
6. Everything inside the destination folder will be deleted forever.
You can also type robocopy in command prompt to see other options. Leave your comments to share which robocopy option you used.
If you enjoyed this post, We would be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter or Facebook. Thank you!
No comments:
Post a Comment