Problems deleting large number of files - painfully slow....

rgames

New member
Local time
1:07 PM
Messages
4
I run a software tool that often generates 75,000 - 100,000 small files that need to be deleted after the software exits. Right now, it can take 8 - 10 minutes to permanently delete all these files from a single run, and I usually have 4 - 8 runs to deal with, so do the math...

I have tried shift-del to permanently delete but it doesn't work - Windows still copies everything to the recycle bin. (I thought shift-del was supposed to bypass the recycle bin...)

Also, while moving the files to the recycle bin, I often get an error message: "Error 0x80070050: The file exists."

Bottom line is that it takes a *really* long time just to delete these files and I need a quicker way to do it.

What's the solution?

Thanks in advance,

rgames
 

My Computer My Computer

At a glance

Windows 7 x64
OS
Windows 7 x64
rgames, mine does the same thing, and you have to realize 75 thousand is a lot of files! ...but I've always noticed 7 takes a lot longer to delete files than XP did, and btw, when you hold down shift-delete notice the prompt that comes up does not really say it's going to the recycle bin, look again, it's a different prompt, but anyway yes you're right it still takes as long, Especially on 75000 files!

I don't have an answer for you either, but I care about it.
 

My Computer My Computer

At a glance

Vista/Win7/8/10/11 (x86/x64)i7
Computer type
PC/Desktop
Computer Manufacturer/Model Number
..all towers built from scratch
OS
Vista/Win7/8/10/11 (x86/x64)
CPU
i7
Workaround / solution - windows 7 slow delete and copy

In Windows Explorer, shift-rightclick a drive or folder, then from context menu, click "open in new process." Go to the new window, and it will behave normally for copying and deleting large and many files.
 

My Computer My Computer

At a glance

windows 7 ultimate 32 bit
OS
windows 7 ultimate 32 bit
CMD prompt (batch file) will be faster than the GUI

Code:
rd C:\lots-of-files /q/s
 

My Computer My Computer

At a glance

W7 Pro SP1 64biti78GBIntel HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
Separate Partition?

How about saving the files to their own partition and "Quick Formatting" it, when you want to kill them?

That should be quick.
 

My Computer My Computer

At a glance

W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, ...AMD Phenom II x6 1100T, 3.3 GHz12GB DDR3 1333 G-Skill (4GB x 2), G-Skill (2G...NVIDIA GeForce GTX 660
Computer type
PC/Desktop
Computer Manufacturer/Model Number
n/a
OS
W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
CPU
AMD Phenom II x6 1100T, 3.3 GHz
Motherboard
ASUS M4A88T-M/USB3 (AM3)
Memory
12GB DDR3 1333 G-Skill (4GB x 2), G-Skill (2GB x 2)
Graphics Card(s)
NVIDIA GeForce GTX 660
Sound Card
Realtek?
Monitor(s) Displays
Samsung S23B350
Screen Resolution
1920x1080
Hard Drives
WD Green 2TB (SATA), WD Green 3TB (SATA), WD Blue 4TB (SATA), WD Blue 6TB (SATA)
PSU
Cooler Master
Case
Antec GX300 Tower
Cooling
3x Antec TRICOOL 120mm Fans
Mouse
Wired Optical
Internet Speed
DSL
Antivirus
Avast
Browser
Pale Moon (64 bit)
Other Info
2018-12-27 Upgraded HDDs
2015-12-10 Upgraded case, graphics card, storage
2015-08-15 Upgraded motherboard & RAM
2015-07-15 Upgraded LM17.1 to LM17.2
How about saving the files to their own partition and "Quick Formatting" it, when you want to kill them?

That should be quick.
That is a great idea - lets hope that the OP stops back by after all these months :-)
 

My Computer My Computer

At a glance

W7 Pro SP1 64biti78GBIntel HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
You can try right clicking on recycle bin and select "Properties". Here you can select the option,
"Don't move files to the Recycle Bin. Remove files immediately when deleted."

Use this option when you wants to delete large number of files. They will be deleted faster than moving to recycle bin. Once deleted, you can reverse this option.

If you are comfortable with command prompt, you can use the delete command in the folder to delete all the files directly. Deleting from command prompt does not send the files to recycle bin.

You can use del *.* in the folder to make it empty quickly. But use caution with this command as you may also delete much needed files in that folder. If the temporary files have a unique extensions you may use del *.ext where ext is the unique extension.

If you know the extensions of the files to be deleted and they are unique, you can add these extensions to the CCleaner program for quickly deleting them. Open CCleaner, go to Options and then Include section. Here you may add custom folders or files in a partition. This will allow you to delete the files in background while you continue working.
 

My Computer My Computer

At a glance

MS Windows 7 Ultimate 64-bit SP1i5-2410M 2.3GHz (2.9GHz Turbo-Boost) Sandy Br...4GB+4GB Samsung DDR3 PC3-10700 (1333 MHz)Video Intel(R) HD Graphics Family, 1696MB ava...
Computer Manufacturer/Model Number
Toshiba Satellite P775-S7232
OS
MS Windows 7 Ultimate 64-bit SP1
CPU
i5-2410M 2.3GHz (2.9GHz Turbo-Boost) Sandy Bridge 32nm
Motherboard
Toshiba PHRAA ver. PSBY1U-00F003
Memory
4GB+4GB Samsung DDR3 PC3-10700 (1333 MHz)
Graphics Card(s)
Video Intel(R) HD Graphics Family, 1696MB available memory
Sound Card
Realtek High Definition Audio version=6.0.1.6323
Monitor(s) Displays
17.3 " Trubrite TFT LCD, LED Backlit
Screen Resolution
1600x900 32 bit, Native support for 720P content
Hard Drives
TOSHIBA MK6476GSXN
580.614 [GB] partitioned C: 80GB and D: 500GB with hidden recovery partitons.

Spare bay for 2nd HDD but no SATA connector :-(
PSU
Toshiba AC/DC Adapter
Case
Notebook
Cooling
Built-in Fan
Keyboard
Premium Raised Tile keyboard
Mouse
Logitech M215 wireless mouse
Internet Speed
Not fast enough
Other Info
Built-in Harman Kardon speakers with Dolby Advanced Audio, Waves MaxxAudio® 3. HDMI, 1xUSB3+3xUSB2 ports, WebCam, Battery life 4hrs 11mins, 4GB Readyboost SDHC card, WD My Book Essential Ext HDDs 2 TB, 2x1TB, My Passport SE 1TB and WDTV 1st Gen for Multimedia playing on a Sony Wega 32" LCD.
Recent addition to my toys are Asus Transformer Pad TF300T with 32GB onboard sd card + 32GB microsd card.
Reply to my own post:
Actually, in Windows Explorer, you can go to Folder Options and checkoff "Launch folder window in a separate process," then copy and delete will act normally.


In Windows Explorer, shift-rightclick a drive or folder, then from context menu, click "open in new process." Go to the new window, and it will behave normally for copying and deleting large and many files.
 

My Computer My Computer

At a glance

windows 7 ultimate 32 bit
OS
windows 7 ultimate 32 bit
Back
Top