Skip to main content

How to delete folders when PATH is too long?

Use Robocopy, or "Robust File Copy"

This is a command-line directory replication command. It has been available as part of the Windows Resource Kit starting with Windows NT 4.0, and was introduced as a standard feature of Windows Vista, Windows 7 and Windows Server 2008.

Robocopy can be downloaded from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17657

The following batch file can do the job. Keep the batch file in your path.

DelFolder.bat

@echo off

if {%1}=={} @echo Syntax: DelFolder FolderPath&goto :EOF

if not exist %1 @echo Syntax: DelFolder FolderPath - %1 NOT found.&goto :EOF

setlocal

set folder=%1

set MT="%TEMP%\DelFolder_%RANDOM%"

MD %MT%

RoboCopy %MT% %folder% /MIR

RD /S /Q %MT%

RD /S /Q %folder%

endlocal

Comments

GabrielNar89 said…
This is a Windows* OS/file system issue.The cause is the directory paths in the system is longer than 255 characters (including spaces).There's a lot of additional softwares which can fix this problem like Long Path Tool.
http://PathTooDeep.com
All you need to do is to download this program online and save all the settings to your computer. This program is compatible with Windows NT, 2000, XP, Vista and Windows 7. Create an icon for the Long Path Tool on your desktop for easy access. Each time you would
like to manage files that have a long filename all you need to do is to click the icon and it will instantly direct you to a window that presents all your files.Here you can rename, delete, open and move your files instantly without the worries of error messages saying that there is some sort of a problem.

Popular posts from this blog

SAAS Simple Maturity Model

There are two architectural models – commonly referred as SAAS Maturity models- that describe the transition of a service to what is called Multi-tenant efficient, highly scalable application. The SAAS Maturity model described by Microsoft has four distinct stages and is illustrated below. Another similar well-known model for SaaS-maturity is known as Forrester-model but adds another stage known as "Dynamic Business Apps-as-a-service". The three key Attributes of a SAAS Architecture: Configurability: Metadata used to configure the way the application behaves for customers Multi-tenant Efficiency : Maximizing the sharing of resources across tenants Scalability: Maximizing concurrency, resource efficiency SAAS Simple Maturity Model (Microsoft, 2006) SaaS Maturity Model (Forres...

CXF Example –Web Service Using Spring and Maven

Apache CXF is an open source services framework. CXF helps you build Web Services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI. Support for bottom up approach and top down approach. Support for Standards JAX-WS, JSR-181, SAAJ, JAX-RS SOAP 1.1, 1.2, WS-I BasicProfile, WS-Security, WS-Addressing, WS-RM, WS-Policy WSDL 1.1 MTOM Building Web Services – Example 1 Develop a simple Web Service using CXF framework. The example in this case is an InterestRate Service. Tools / technologies Version CXF 2.1 Maven 2.0 Tomcat apache-tomcat-6.0.24 JDK java version 1.6.0_20       The Application Scope The "Interest Rate Service" application demonstrates how easily you can develop a Web Service using CXF frame work. The WSDL service definition defines three operations. Below is the InterestRateService interface.   @WebS...

What is an ESB?

ESB is another of these amorphous terms that means different things to different people. An ESB can be thought of as the next generation of Service Oriented Architecture. Everybody knows web services today, and they have been used extensively to allow companies to break the tyranny of proprietary architectures. Now you can wire applications to service providers without having to know or worry about the provider's underlying operating system or programming language. It is an architectural concept/construct - not a technology, despite some vendors (and even gartner) telling you otherwise. You'll find many different types of technology can fulfil the conceptual role of an ESB, hence be careful not to associate it with a particular technology. Therefore designing the architecture is more important than choosing a 'product'. An Enterprise Service Bus (ESB) is the "backbone" of the service-oriented architectural model which allows different protocols to be communica...