Corrupted / 0 byte file finder

Post your working scripts, libraries and tools
xcloudx01
Posts: 4
Joined: 05 Oct 2017, 00:27

Corrupted / 0 byte file finder

05 Oct 2017, 00:57

This tool scans your computer for any files which are 0 bytes in size. Often a file that gets corrupted becomes 0 bytes.
I've had random exe, iso and video files become corrupted for no reason, so I made this to find every potentially corrupted file so I can get rid of/replace them.

Instructions:

Select the folder you'd like to scan, and if you'd like to scan sub-directories.
Click the "Find zero byte files" button.
If any 0 byte files are detected, a list will open up detailing them. Double click to go to them in explorer, right click to delete them or copy their path.
Don't just randomly delete every single thing it finds, figure out if what it found is something of importance, like if the file is one of your family videos or something.

GitHub with compiled version for download: https://github.com/Draqen4/Empty-Corrupted-File-Finder/

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by xcloudx01 on 07 Oct 2017, 23:11, edited 8 times in total.
Helgef
Posts: 2225
Joined: 17 Jul 2016, 01:02
Contact:

Re: Corrupted / 0 byte file finder

05 Oct 2017, 03:11

Great, thanks for sharing :thumbup:
It works well, but maybe add abillity to delete more than one file at a time. Also, your script will benefit from SetBatchLines,-1.

Cheers.
xcloudx01
Posts: 4
Joined: 05 Oct 2017, 00:27

Re: Corrupted / 0 byte file finder

05 Oct 2017, 03:16

I was a bit unsure actually on how to do that bit correctly. If you know how to correctly implement that I'd happily add it into the code :). I gave it a go but it'd only output the last thing selected.
Cheers i forgot about the batchlines thing. Added it in.
rommmcek
Posts: 255
Joined: 15 Aug 2014, 15:18

Re: Corrupted / 0 byte file finder

07 Oct 2017, 00:07

There may be a better way, but this one works for me:

Code: [Select all] [Download] GeSHi © Codebox Plus

ifMsgBox yes
{
Gui,2:default ;Needed to delete items from list with LV_Delete
loop, % LV_GetCount("S")
{
LV_GetText(LvText, LV_GetNext(-1))
LV_Delete(LV_GetNext(-1))
FileDelete, % LvText
}
}
Of course -multi option should be removed!
xcloudx01
Posts: 4
Joined: 05 Oct 2017, 00:27

Re: Corrupted / 0 byte file finder

07 Oct 2017, 07:52

That did the trick, thanks :D. Added it to the code, and also made it so the delete key works.
rommmcek
Posts: 255
Joined: 15 Aug 2014, 15:18

Re: Corrupted / 0 byte file finder

07 Oct 2017, 12:01

As a persistent keyboard user I added:

Code: [Select all] [Download] GeSHi © Codebox Plus

	AppsKey::
Gui,2: default ;Needed to delete items from list with LV_Delete
if (LV_GetCount("S") > 0) {
Click, 100, 100, 0
Menu,Menu1,Show
}
return
But I'm sure, you will find more elegant solution!
xcloudx01
Posts: 4
Joined: 05 Oct 2017, 00:27

Re: Corrupted / 0 byte file finder

07 Oct 2017, 20:10

rommmcek wrote:As a persistent keyboard user I added:

Code: [Select all] [Download] GeSHi © Codebox Plus

	AppsKey::
Gui,2: default ;Needed to delete items from list with LV_Delete
if (LV_GetCount("S") > 0) {
Click, 100, 100, 0
Menu,Menu1,Show
}
return
But I'm sure, you will find more elegant solution!


What line in the code did you add this to? I seem to be able to navigate the program okay using just the keyboard
rommmcek
Posts: 255
Joined: 15 Aug 2014, 15:18

Re: Corrupted / 0 byte file finder

07 Oct 2017, 21:45

I just appended it to the end of your code. (AppsKey did not show menu for me in Gui2 when some lines were selected)
Besides, I find useful:

Code: [Select all] [Download] GeSHi © Codebox Plus

	~Esc::
2GuiClose:
GuiControl 1:,ProgressBar,0
GuiControl 1:,ScanningText,
...
Bye!

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 11 guests