5

I have over 2,000,000 (that's right, over 2 million) files in 'Temporary Internet Files'.

This predicament is the result of a scheduled task that runs a script. After installing Visual Studio, it has been generating numerous 'Assembly Binder Log Entry' .HTM files each time it runs.

It's been doing this every 15 minutes for 8 months. So now there's over 2,000,000 and 8 GB worth of these files in there (no wonder WinDirStat and Everything have been crashing!).


How can I delete a folder without iterating over all 2,000,000 of its contents?

I tried opening the parent folder in Explorer and simply pushing the Del key. Windows then proceeded to attempt sending 2,000,000 files to the Recycle Bin (nope). It never got past the 'Discovering Items' phase.

I went for PowerShell next (Remove-Item 'Content.IE5'), but it's attempting to recurse through each file and delete them individually. While this seems like it will work eventually, I feel like there must be a better way.

Bonus points if you can tell me what the heck Assembly Binder Log Entry files are...

rtf
  • 12,686
  • 1
    What about using rmdir? The command rmdir /s [FOLDER TO DELETE] should do the trick. – Breakthrough Jul 03 '14 at 22:09
  • 3
    Not a solution, just a tip: Shift+Del removes files immediately without moving them to Recycle Bin. – gronostaj Jul 03 '14 at 22:10
  • 1
    I'm afraid that, whatever you do, the files will be deleted individually: the directory entry has to be checked to find out which blocks to free in the volume's bit-map before the file entry is removed, and the deletions will always be done one at a time to minimise corruptions if there should be a power failure. There are disc-caching tools available which would speed up the process, but you will probably spend more time finding and installing them than they will save you. I agree that rmdir /s is probably as quick as you'll get. Set it going one night and see how far it gets. – AFH Jul 03 '14 at 22:47
  • As a footnote, I am not sure about PowerShell, but CMD deletions bypass the recycle bin. – AFH Jul 03 '14 at 22:53

3 Answers3

3

According to a similar question from StackOverflow there are a couple things you can do. Quoting from the highest rated answer (not the accepted) the best method of doing such as task is:

The best I've found is a two line batch file with a first pass to delete files and outputs to nul to avoid the overhead of writing to screen for every singe file. A second pass then cleans up the remaining directory structure:

> del /f/s/q foldername > nul 
> rmdir /s/q foldername

Obviously you will need to adapt this answer to suite your specific purposes since you are deleting a series of files rather than a folder.

This user suggests (and I would agree) the worst way to achieve such a task would be select all and Del with next worst being select all Shift+Del

Afraid I have no idea what the log entry file is.

Source - stackoverflow

0

Try this:

Start > Run > cmd > cd to desired directory

once in desired directory or parent directory type del (example) C:\Users\username\Desktop*desiredfile.ext

This will delete files without confirmation.

injector
  • 950
0

Turn off 8+3 file names, delete from the command line, turn 8+3 back on again. Keeping track of that extra set of file names adds overhead once you get past the first few ten thousand files.