We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Dealing with large number of files on a USB drive, Windows is too slow
Options

buglawton
Posts: 9,246 Forumite


in Techie Stuff
I am trying to tidy up a folder of files on a USB hard drive. Have about 30,000 files to delete within the folder before I transfer the remainder to another drive.
Windows File Explorer can find the files based on a search criteria within 30 seconds. But the moment I try to select a large range of these or ctrl-A for all, it goes into a funk. I can see it will take hours based on the ongoing count in bottom corner.
I'd be curious to know if there are other point and click utilities that can say, select out all files under 5k bytes in size and then delete them within a folder structure.
Windows File Explorer can find the files based on a search criteria within 30 seconds. But the moment I try to select a large range of these or ctrl-A for all, it goes into a funk. I can see it will take hours based on the ongoing count in bottom corner.
I'd be curious to know if there are other point and click utilities that can say, select out all files under 5k bytes in size and then delete them within a folder structure.
0
Comments
-
I am trying to tidy up a folder of files on a USB hard drive. Have about 30,000 files to delete within the folder before I transfer the remainder to another drive.
Windows File Explorer can find the files based on a search criteria within 30 seconds. But the moment I try to select a large range of these or ctrl-A for all, it goes into a funk. I can see it will take hours based on the ongoing count in bottom corner.
I'd be curious to know if there are other point and click utilities that can say, select out all files under 5k bytes in size and then delete them within a folder structure.
are they media or image files of some sort or other?
If so this can cause the problem you have as if memory serves me, I could be wrong as it's been a while, explorer creates thumbnail images in the background even if you have no intention of displaying them.
For this reason I'd do this from the cmd line in terminal or create a batch file to do it.
I have no idea about other graphical programs.One by one the penguins are slowly stealing my sanity.0 -
Exactly, Explorer created a 4k byte file for each JPEG. Now you mention it, I recall there's a way to tell Windows to put these in a separate cache folder. More research needed methinks. If the tiny files are not persistent on the usb drive then a Simple DOS copy would do it.0
-
Lets get this straight, you want to delete files below a given size?
Pop this in a batch file:
for /f "usebackq delims=;" %%F in (`dir /s /b *.jpg`) do If %%~zF LSS 9500 del /q "%%F"
9500 = 9.5KB
jpg = file type
Create a new line for each file type and change jpg to the desired file type.
You'll need to add random text to the end of the file in order to stop it deleting itself (IMPORTANT!!).
Pop the file in the directory in which the files/folders are located and then run the file. It will delete any and all files below the defined file size, in the current directory and all sub-directories.“I may not agree with you, but I will defend to the death your right to make an a** of yourself.”
<><><><><><><><><<><><><><><><><><><><><><> Don't forget to like and subscribe \/ \/ \/0 -
Strider590 wrote: »Lets get this straight, you want to delete files below a given size?
Pop this in a batch file:
for /f "usebackq delims=;" %%F in (`dir /s /b *.jpg`) do If %%~zF LSS 9500 del /q "%%F"
9500 = 9.5KB
jpg = file type
Create a new line for each file type and change jpg to the desired file type.
You'll need to add random text to the end of the file in order to stop it deleting itself (IMPORTANT!!).
Pop the file in the directory in which the files/folders are located and then run the file. It will delete any and all files below the defined file size, in the current directory and all sub-directories.
That's the one.
I knew someone would be along who knew the syntax :T
I couldn't remember how last night without looking it up and I was tiredOne by one the penguins are slowly stealing my sanity.0 -
You could copy out the files you want, and then re-format the drive.0
-
That's the one.
I knew someone would be along who knew the syntax :T
I couldn't remember how last night without looking it up and I was tired
It took me ages to come up with that, it appears in a couple of online forums, but needed some tweaking to get it working properly.
About 2 weeks ago I wrote it in as part of a large batch file that's responsible for running my CCTV webcam (movement sensitive time lapse), I needed something that would delete all the blank images (everything under 9.5KB) before making the automatic evening backup to my NAS, as these blank images were taking up near 10GB of space!!!“I may not agree with you, but I will defend to the death your right to make an a** of yourself.”
<><><><><><><><><<><><><><><><><><><><><><> Don't forget to like and subscribe \/ \/ \/0 -
My only criticism of the BATch file line is that "usebackq" is unnecessary, and the ` (back quote) characters can be replaced by the normal ' (single quote) characters!0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.8K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.8K Work, Benefits & Business
- 598.7K Mortgages, Homes & Bills
- 176.8K Life & Family
- 257.1K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards