Batch read barcodes from files is easy to implement in VBScript if you use these source codes below. Want to batch read barcodes from files in your VBScript app? ByteScout BarCode Reader SDK is designed for it. ByteScout BarCode Reader SDK is the SDK for reading of barcodes from PDF, images and live camera or video. Almost every common type like Code 39, Code 128, GS1, UPC, QR Code, Datamatrix, PDF417 and many others are supported. Supports noisy and defective images and docs. Includes optional documents splitter and merger for pdf and tiff based on found barcodess. Batch mode is supported for superior performance using multiple threads. Decoded values are easily exported to JSON, CSV, XML and to custom format.
VBScript code samples for VBScript developers help to speed up coding of your application when using ByteScout BarCode Reader SDK. This VBScript sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Implementing VBScript application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.
Download free trial version of ByteScout BarCode Reader SDK from our website with this and other source code samples for VBScript.
if WScript.Arguments.Count < 2 Then MsgBox "Run with the folder path as the argument" & vbCRLF & vbCRLF & "BatchReadFromFiles.vbs <InputFolder> <OutputFolder>" WScript.Quit 0 End If Set objFSO = CreateObject("Scripting.FileSystemObject") ' define allowed input images extensions inputImagesExtensions = "JPG,JPEG,PNG,BMP,PDF,TIF" Set reader = CreateObject("Bytescout.BarCodeReader.Reader") ' Set barcode types for searching reader.BarcodeTypesToFind.Code39 = True reader.BarcodeTypesToFind.QRCode = True reader.BarcodeTypesToFind.PDF417 = True reader.BarcodeTypesToFind.EAN13 = True Set objInputFolder = objFSO.GetFolder(WScript.Arguments(0)) Set objResultsFile = objFSO.CreateTextFile(WScript.Arguments(1), True) Call ProcessFolder(objInputFolder) WScript.Quit 0 Sub ProcessFolder(folder) Set objFolder = objFSO.GetFolder(folder.Path) Set colFiles = objFolder.Files For Each objFile in colFiles ' Check the file type If inStr(inputImagesExtensions, UCase(objFSO.GetExtensionName(objFile.Name))) > 0 Then ' Read barcode from file WScript.Echo "Reading from: " & objFile.Path reader.ReadFromFile objFile.Path Dim csv csv = reader.ExportFoundBarcodesToCSV_4 objResultsFile.Write csv End If Next For Each subFolder in folder.SubFolders ProcessFolder subFolder Next End Sub
REM running from the command line cscript.exe BatchReadFromFiles.vbs "input" "results.csv" pause