If there
is a problem package in SCCM when using "Download content locally"
then try running this script against the original source.
SCCM may
be downloading the content and then failing when running a hash check because
not all the files from the DP have succesfully been downloaded to the local
drive.
This
script shows all file names that contain invalid characters and any hidden
files.
There is
also a hotfix available for SP2: http://support.microsoft.com/kb/2507187/en-us
' Syntax is cscript.exe badfiles.vbs <path>
Option ExplicitDim sPath, oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")sPath = WScript.Arguments(0)Find sPathSub Find(ByVal sPath)
Dim oFolder, oFileSet 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 SubSub DoChecks(ByVal sName, ByVal bIsFolder)
Dim sString, i, oFileFolderIf 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
No comments:
Post a Comment