The problem: you have dozens or even thousands of files on your Windows Home Server that cannot be read due to an "invalid file handle" problem. You can delete each one individually, but it will take forever... You probably lost a hard disc or had a bad episode while removing a disc.
This tool is for Windows Home Server. It reads files on your Windows Home Server to test if they are readable. It is meant to solve the "Invalid File Handle" problem. It does this by testing if a file is readable. If it is not readable it:
You must check the contents of the .cmd file prior to running it! I have found it to be correct, but you don't want to be surprised, upset or experience any unpleasant emotion after running it. If you don't feel OK about running it, then don't.
Running the .cmd will delete the reparse points, effectively deleting undeletable, unreadable files.
To see how it works, run it against your desktop computer on, say, the C:\temp directory. I trust that C:\WHScleanup.cmd will be empty afterwards.
Normally you run it on your WHS against D:\shares but you might just do it against one of your shared folders. eg D:\shares\music
You must run the application from a local disc on the WHS - not a network file share from a client PC. In other words, copy it to the C: drive on your WHS and run it under Remote Desktop.
If you do end up with entries in the .cmd file then go and take a look at a few of the relevant files on your server before you run the .cmd file. Try reading them or copying them. Try this with a few files.
Sometimes the .cmd file still can't delete the reparse points. That's a problem I can't solve. This seems to usually occur with filenames that use characters that are not native to the installed language on your WHS.
I, the author, am pretty sure this works well. The only way I can think of that it could adversely affect your files is if you run the C:\WHScleanup.cmd file without inspecting it, thinking about, and making an informed decision to run it. There may also be error events that I have not forseen and therefore not catered for in the code. If you can do better, then download the source code and improve and share it.
I expressly disclaim all liability for any adverse affects, direct or indirect, to your computer, files or any other thing, whether through negligence or otherwise from the use of this software. By using this software you agree to this disclaimer and hold me free of any claim in relation to the use of the software.
The source code is available on this site. You should satisfy yourself that it does what you want and what you expect. The compiled executable available on this site was compiled in Visual Studio 2005 from that code.
I advise a full backup of your entire server if you are the sort of person who will get upset at unnecessarily deleted files when you run the .cmd file. I don't think the .cmd files generated by this application will do that, but it MIGHT. You have no recourse to me, so it's all in your hands.
You should, by now, understand that you run this software and the generated .cmd file at your own risk.
If you have a problem, suggestion or a revised better version, post a message at http://forums.microsoft.com/WindowsHomeServer.
Visual Studio Project