I was assisting a customer with deploying Adobe CS3 via SCCM 2007 and was hitting a brick wall with the package deployment constantly failing on all machines with:
Hash could not be matched for the downloaded content. Original ContentHash = 7C2BFDF0162EF4E5AE6D67EDED6F9A404B74D64B, Downloaded ContentHash = 5C338435615D6A6EAAFED329A97486D2D358CEA8 Failed to resolve the source for SMS PKGID=xxxxxxxx, hr=0x80091007
I spent ages checking for hidden files, checking the WebDAV configuration on the BITS enabled distribution points for any requestFiltering that may be causing the issue, deleting the package from all DPs, deleting the package from within SCCM, re-doing the sources, removing binary differential compression etc. You name it, I’d tried it.
Finally I found the root cause of the issue: A “foreign” character in one of the filenames. For some reason this was causing the hash mismatch (0x80091007) issue.
I wrote the following VBScript very quickly to help me in the future to find any hidden files or any files with “foreign” characters in their name. It’s not the best implementation but it works (for me anyway!).
Option Explicit Dim sPath, oFSO Set oFSO = CreateObject("Scripting.FileSystemObject") sPath = WScript.Arguments(0) Find sPath Sub Find(ByVal sPath) Dim oFolder, oFile Set oFolder = oFSO.GetFolder(sPath) If Err.Number = 0 Then For Each oFile in oFolder.Files If Err.Number = 0 Then DoChecks oFile.Path, False Else Err.Clear End If Next For Each oFolder in oFolder.SubFolders If Err.Number = 0 Then DoChecks oFolder.Path, True Find oFolder.Path Else Err.Clear End If Next Else Err.Clear End If End Sub Sub DoChecks(ByVal sName, ByVal bIsFolder) Dim sString, i, oFileFolder If bIsFolder = True Then Set oFileFolder = oFSO.GetFolder(sName) Else Set oFileFolder = oFSO.GetFile(sName) End If If Err.Number = 0 Then If oFileFolder.Attributes AND 2 Then WScript.Echo "HIDDEN: " & sName End If Else Err.Clear End If sString = Mid(sName, InStrRev(sName, "\") + 1, Len(sName)) For i = 1 To Len(sString) If Asc(Mid(sString, i, 1)) < 32 Or Asc(Mid(sString, i, 1)) > 126 Then WScript.Echo "BAD CHARACTER: " & sName End If Next End Sub
Example usage:
cscript FindBadFiles.vbs C:\Sources
Hopefully this’ll save someone else hours of troubleshooting.