Cannot Delete: Path Too Long
Just now I ran into a problem with an installation of a product which had very deep folder structures. I had to uninstall and delete the folders and files in order to do a fresh install. When I attempted to delete the files through Explorer and the cmd prompt I was being told that either the path was too long or the file name was too long.
Perhaps I’ve been doing development too long because I could not remember for the life of me how to get around this problem. After a few quick searches I was reminded of the the syntax “\\.\” and this solved my problem. I wanted to remove everything from the root folder of the application.
To remove folders and files:
ex. rd “\\.\c:\Path to long directory” /s /q
To removefiles
ex. del “\\.\c:\Path to file”
Give credit where credit is due:
- My good friend Jeremy Simmons
- Microsoft Support
- Where my memory was jogged: IT News Group.NET which is simply an alias to: microsoft.public.windows.server.general