Skip to content

Commit 2ef6239

Browse files
committed
Allow longer file names and add error handling
1 parent 6f80699 commit 2ef6239

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

VBScript/Build.vbs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,22 @@ Else
377377
If objFileSystemObject.FolderExists(strScriptDir & strSubfolderName & "\") Then
378378
Set objFolder = objFileSystemObject.GetFolder(strScriptDir & strSubfolderName & "\")
379379
Set objADODBRecordSet = CreateObject("ADODB.RecordSet")
380-
objADODBRecordSet.Fields.Append "FilePath", adVarChar, 255
380+
objADODBRecordSet.Fields.Append "FilePath", adVarChar, 300
381381
objADODBRecordSet.CursorType = adOpenStatic
382382
objADODBRecordSet.Open
383383
Set arrFiles = objFolder.Files
384384
For Each objFile in arrFiles
385+
On Error Resume Next
385386
objADODBRecordSet.AddNew "FilePath", objFile.Path
386387
'objADODBRecordSet.Fields(0) = objFile.Path
387388
objADODBRecordSet.Update
389+
If Err Then
390+
On Error Goto 0
391+
Err.Clear
392+
WScript.Echo("An error occurred processing the file: " & objFile.Path)
393+
Else
394+
On Error Goto 0
395+
End If
388396
Next
389397
objADODBRecordSet.Sort = "FilePath"
390398
If objADODBRecordSet.BOF = False Then objADODBRecordSet.MoveFirst()

0 commit comments

Comments
 (0)