checking for file corruption on USB drives

does anyone know of a program that will scan files on a USB stick (or drive) and detect file corruption?

I ask because I have a USB stick that seems to be flaky (still in the process of confirming the stick is the culprit).

When I go to run a program from it, Windows will say "sorry Dave, I cannot do that due to file being corrupt" - you get the picture.

Of course this happens at the most inconvenient time when I want that software to just work.

So I was thinking there may be something that works on the CRC, MD5 or similar level and gives a picture of the 'health' of the files on the drive (not the drive itself).

On mine I run ChkDsk using a read-only scan, example:

chkdsk j:

If it finds problems I copy the whole drive contents into a New Folder on the desktop and then format the USB stick, I've had to do that twice on one of mine and it no longer gives me issues. Possibly Windows at fault some of the time.

Note when using ChkDsk to scan a USB stick I don't bother using the /f "fix" parameter anymore since it can often make a complete mess if it "detects" a problem.

Edit:

I had forgot about the old software tool Emsa DiskCheck (freeware, requires getting a free license key though), it scans for errors using Windows own built in routines, it may be helpful:

when i have found corrupted files, CHKDSK didn't detect anything.

i guess it doesn't 'look into' the file for that sort of problems.

i have had a play with Fastsum but it didn't seem able to look at sub-folders under the folder i wanted scanned.

CheckMD5 seemed OK but put 'checksum.md5' files in every folder which didn't appeal.

i'm currently getting to grips with FCIV (file checksum integrity viewer) from Microsoft, very small, free & portable, but command line driven (but we can't have everything).

i've made a batch file to get it to verify or create on demand and it may just be the answer i was seeking.... ....unless someone can put forward alternatives. ;)

HashMyFiles from Nirsoft allows you to drag-drop a folder and it reports all the hash checksums you require for each and every file within the folder.

It may explore all sub-directory levels - I have not tried.

It is portable

It will not by itself predict whether your unspecified program will deem a file to be corrupted,

but it will instantly compare the files in a flash drive with files held on a HDD,

and you can save results to a text file and at a later date you can run it and create a new text file,

and then compare the two text files to observe whether changes have occurred.

Win xp, hasher ver 1.95 here.

Alan, I tried a folder with sub folders here and hasher will only open & analyze files in the top folder.