We help IT Professionals succeed at work.

Deleting a folder with 1 million files on Windows Server 2008

480 Views
Last Modified: 2018-02-02
I am trying to delete a folder that has about 1 million files in it.  It is a Windows Server 2008.  It is a temporary folder containing small XML files that were I guess downloaded when a SQL Server Job was being executed that imported data from an XML Feed.

The problem is that I try deleting the files via command prompt and it just doesn't work.  I think it ends up hanging due to enumerating the files.  I am not sure how to delete all of the files without enumerating.

Any help would be appreciated!
Comment
Watch Question

Scott SilvaNetwork Administrator
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Lead SaaS Infrastructure Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
MaheshArchitect
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
one other option could be open folder within WinRAR and delete from WinRAR itself, you do need to install WinRAR trial version on server

I have used WinRAR to delete folders which contains files with more than 220 characters long

Author

Commented:
Thanks guys!  The hosts manage to do it for me just before your solution was posted but I'll be using it for future.  Appreciate it.
Ben Personick (Previously QCubed)Lead SaaS Infrastructure Engineer
CERTIFIED EXPERT

Commented:
Glad to Help Adrian :)